@dodoex/wallet-web3 0.0.22-11 → 0.0.22-12
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/__node-resolve_empty-c26046ba.js +1 -0
- package/dist/__tslib-0d114b26.js +1 -0
- package/dist/{blocto-8c2085d3.js → blocto-eba346c7.js} +1 -1
- package/dist/{bn-1f530cbf.js → bn-4ca2c470.js} +1 -1
- package/dist/{browser-ponyfill-65f461af.js → browser-ponyfill-9645e625.js} +1 -1
- package/dist/cjs/{__node-resolve_empty-48770c48.cjs → __node-resolve_empty-f823f66f.cjs} +1 -1
- package/dist/cjs/__tslib-f2c04083.cjs +1 -0
- package/dist/cjs/{blocto-4ee8921f.cjs → blocto-a8cfa504.cjs} +1 -1
- package/dist/cjs/{bn-8f1adf30.cjs → bn-46f00f80.cjs} +1 -1
- package/dist/cjs/{browser-ponyfill-598b2449.cjs → browser-ponyfill-e3303cd3.cjs} +1 -1
- package/dist/cjs/{ethers-8fe768ef.cjs → ethers-49ddc5d3.cjs} +1 -1
- package/dist/cjs/{id-502c4904.cjs → id-e5478f9c.cjs} +1 -1
- package/dist/cjs/{index-c7f0704f.cjs → index-264e282d.cjs} +1 -1
- package/dist/cjs/{index-b1204b05.cjs → index-2dade254.cjs} +1 -1
- package/dist/cjs/index-3e706c23.cjs +9 -0
- package/dist/cjs/{index-01296348.cjs → index-555531ed.cjs} +1 -1
- package/dist/cjs/{index-8df45c02.cjs → index-974dd113.cjs} +2 -2
- package/dist/cjs/{index-4aa7d300.cjs → index-ae69c0db.cjs} +1 -1
- package/dist/cjs/index-c04f0ca9.cjs +1 -0
- package/dist/cjs/{index-ebd62943.cjs → index-e65ae526.cjs} +1 -1
- package/dist/cjs/{index-2827d533.cjs → index-eed80078.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{index.es-d51eeb46.cjs → index.es-bc520601.cjs} +1 -1
- package/dist/cjs/{interface-c39ec3db.cjs → interface-7d7df207.cjs} +1 -1
- package/dist/cjs/{portis-175b07ca.cjs → portis-2348e9fa.cjs} +1 -1
- package/dist/cjs/{provider-938ef5fe.cjs → provider-15aec971.cjs} +1 -1
- package/dist/cjs/{rainbow-f192befb.cjs → rainbow-030e7cdd.cjs} +1 -1
- package/dist/cjs/{typed-data-ab7491ff.cjs → typed-data-e5ba4465.cjs} +1 -1
- package/dist/cjs/{uAuth-d437697a.cjs → uAuth-5f335d02.cjs} +1 -1
- package/dist/cjs/{walletConnect-3aca3d1f.cjs → walletConnect-95e27f96.cjs} +1 -1
- package/dist/cjs/walletLink-4ea31baa.cjs +1 -0
- package/dist/{ethers-42853299.js → ethers-af5ccc08.js} +1 -1
- package/dist/{id-52a9f75e.js → id-903f53ce.js} +1 -1
- package/dist/index-08612a78.js +1 -0
- package/dist/{index-97a040f7.js → index-209b869b.js} +1 -1
- package/dist/{index-5c89024a.js → index-9553397a.js} +2 -2
- package/dist/{index-39688209.js → index-a35199e0.js} +1 -1
- package/dist/{index-211c5b4b.js → index-bebed5ea.js} +1 -1
- package/dist/index-c9ea4447.js +9 -0
- package/dist/{index-cfc9c3fb.js → index-d40289c6.js} +1 -1
- package/dist/{index-1d3eabdb.js → index-d83600a1.js} +1 -1
- package/dist/{index-55e4f8e1.js → index-e7dfeec6.js} +1 -1
- package/dist/{index.es-41000d2a.js → index.es-5212e81c.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{interface-2f9b4a24.js → interface-fddfde7b.js} +1 -1
- package/dist/{portis-e775de05.js → portis-0c106b2f.js} +1 -1
- package/dist/{provider-96970f92.js → provider-d4b6a806.js} +1 -1
- package/dist/{rainbow-de827ed8.js → rainbow-5baf85e9.js} +1 -1
- package/dist/{typed-data-fe3dc5e9.js → typed-data-285fa285.js} +1 -1
- package/dist/{uAuth-f5a3d9ba.js → uAuth-1288cdb7.js} +1 -1
- package/dist/{walletConnect-d9267fb8.js → walletConnect-ac8b2fe3.js} +1 -1
- package/dist/walletLink-62bbad88.js +1 -0
- package/package.json +1 -1
- package/dist/__node-resolve_empty-531dda90.js +0 -1
- package/dist/__tslib-f5f693c5.js +0 -1
- package/dist/cjs/__tslib-6259fdc9.cjs +0 -1
- package/dist/cjs/index-3a575bbf.cjs +0 -1
- package/dist/cjs/index-dc794df6.cjs +0 -9
- package/dist/cjs/walletLink-875f9b07.cjs +0 -1
- package/dist/index-978bb94d.js +0 -9
- package/dist/index-d72c92c2.js +0 -1
- package/dist/walletLink-424dd093.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@ethersproject/bytes"),t=require("@ethersproject/properties"),r=require("./id-
|
|
1
|
+
"use strict";var e=require("@ethersproject/bytes"),t=require("@ethersproject/properties"),r=require("./id-e5478f9c.cjs");function o(t){t=atob(t);const r=[];for(let e=0;e<t.length;e++)r.push(t.charCodeAt(e));return e.arrayify(r)}function n(t){t=e.arrayify(t);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}var s=function(e,t,r,o){return new(r||(r=Promise))((function(n,s){function l(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(l,i)}c((o=o.apply(e,t||[])).next())}))};function l(t,r){return s(this,void 0,void 0,(function*(){null==r&&(r={});const o={method:r.method||"GET",headers:r.headers||{},body:r.body||void 0};if(!0!==r.skipFetchSetup&&(o.mode="cors",o.cache="no-cache",o.credentials="same-origin",o.redirect="follow",o.referrer="client"),null!=r.fetchOptions){const e=r.fetchOptions;e.mode&&(o.mode=e.mode),e.cache&&(o.cache=e.cache),e.credentials&&(o.credentials=e.credentials),e.redirect&&(o.redirect=e.redirect),e.referrer&&(o.referrer=e.referrer)}const n=yield fetch(t,o),s=yield n.arrayBuffer(),l={};return n.headers.forEach?n.headers.forEach(((e,t)=>{l[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{l[e.toLowerCase()]=n.headers.get(e)})),{headers:l,statusCode:n.status,statusMessage:n.statusText,body:e.arrayify(new Uint8Array(s))}}))}var i=function(e,t,r,o){return new(r||(r=Promise))((function(n,s){function l(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(l,i)}c((o=o.apply(e,t||[])).next())}))};const c=new r.Logger("web/5.7.1");function a(e){return new Promise((t=>{setTimeout(t,e)}))}function u(t,o){if(null==t)return null;if("string"==typeof t)return t;if(e.isBytesLike(t)){if(o&&("text"===o.split("/")[0]||"application/json"===o.split(";")[0].trim()))try{return r.toUtf8String(t)}catch(e){}return e.hexlify(t)}return t}function h(e,s,h){const d="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;c.assertArgument(d>0&&d%1==0,"invalid connection throttle limit","connection.throttleLimit",d);const f="object"==typeof e?e.throttleCallback:null,p="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;c.assertArgument(p>0&&p%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",p);const y="object"==typeof e&&!!e.errorPassThrough,m={};let g=null;const E={method:"GET"};let w=!1,b=12e4;if("string"==typeof e)g=e;else if("object"==typeof e){if(null!=e&&null!=e.url||c.throwArgumentError("missing URL","connection.url",e),g=e.url,"number"==typeof e.timeout&&e.timeout>0&&(b=e.timeout),e.headers)for(const t in e.headers)m[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(w=!0);if(E.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==g.substring(0,6)&&!0!==e.allowInsecureAuthentication&&c.throwError("basic authentication requires a secure https url",r.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:g,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;m.authorization={key:"Authorization",value:"Basic "+n(r.toUtf8Bytes(t))}}null!=e.skipFetchSetup&&(E.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(E.fetchOptions=t.shallowCopy(e.fetchOptions))}const v=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),R=g?g.match(v):null;if(R)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":R[1]||"text/plain"},body:R[2]?o(R[3]):(C=R[3],r.toUtf8Bytes(C.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return h&&(t=h(e.body,e)),Promise.resolve(t)}catch(e){c.throwError("processing response error",r.Logger.errors.SERVER_ERROR,{body:u(R[1],R[2]),error:e,requestBody:null,requestMethod:"GET",url:g})}var C;s&&(E.method="POST",E.body=s,null==m["content-type"]&&(m["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==m["content-length"]&&(m["content-length"]={key:"Content-Length",value:String(s.length)}));const S={};Object.keys(m).forEach((e=>{const t=m[e];S[t.key]=t.value})),E.headers=S;const L=function(){let e=null;return{promise:new Promise((function(t,o){b&&(e=setTimeout((()=>{null!=e&&(e=null,o(c.makeError("timeout",r.Logger.errors.TIMEOUT,{requestBody:u(E.body,S["content-type"]),requestMethod:E.method,timeout:b,url:g})))}),b))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),O=function(){return i(this,void 0,void 0,(function*(){for(let e=0;e<d;e++){let t=null;try{if(t=yield l(g,E),e<d)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===E.method&&e.match(/^https:/)){g=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(f&&(r=yield f(e,g)),r){let r=0;const o=t.headers["retry-after"];r="string"==typeof o&&o.match(/^[1-9][0-9]*$/)?1e3*parseInt(o):p*parseInt(String(Math.random()*Math.pow(2,e))),yield a(r);continue}}}catch(e){t=e.response,null==t&&(L.cancel(),c.throwError("missing response",r.Logger.errors.SERVER_ERROR,{requestBody:u(E.body,S["content-type"]),requestMethod:E.method,serverError:e,url:g}))}let o=t.body;if(w&&304===t.statusCode?o=null:!y&&(t.statusCode<200||t.statusCode>=300)&&(L.cancel(),c.throwError("bad response",r.Logger.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:u(o,t.headers?t.headers["content-type"]:null),requestBody:u(E.body,S["content-type"]),requestMethod:E.method,url:g})),h)try{const e=yield h(o,t);return L.cancel(),e}catch(n){if(n.throttleRetry&&e<d){let t=!0;if(f&&(t=yield f(e,g)),t){const t=p*parseInt(String(Math.random()*Math.pow(2,e)));yield a(t);continue}}L.cancel(),c.throwError("processing response error",r.Logger.errors.SERVER_ERROR,{body:u(o,t.headers?t.headers["content-type"]:null),error:n,requestBody:u(E.body,S["content-type"]),requestMethod:E.method,url:g})}return L.cancel(),o}return c.throwError("failed response",r.Logger.errors.SERVER_ERROR,{requestBody:u(E.body,S["content-type"]),requestMethod:E.method,url:g})}))}();return Promise.race([L.promise,O])}function d(e,o,n){let s=null;if(null!=o){s=r.toUtf8Bytes(o);const n="string"==typeof e?{url:e}:t.shallowCopy(e);if(n.headers){0!==Object.keys(n.headers).filter((e=>"content-type"===e.toLowerCase())).length||(n.headers=t.shallowCopy(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};e=n}return h(e,s,((e,t)=>{let o=null;if(null!=e)try{o=JSON.parse(r.toUtf8String(e))}catch(t){c.throwError("invalid JSON",r.Logger.errors.SERVER_ERROR,{body:e,error:t})}return n&&(o=n(o,t)),o}))}function f(e,r){return r||(r={}),null==(r=t.shallowCopy(r)).floor&&(r.floor=0),null==r.ceiling&&(r.ceiling=1e4),null==r.interval&&(r.interval=250),new Promise((function(t,o){let n=null,s=!1;const l=()=>!s&&(s=!0,n&&clearTimeout(n),!0);r.timeout&&(n=setTimeout((()=>{l()&&o(new Error("timeout"))}),r.timeout));const i=r.retryLimit;let c=0;!function n(){return e().then((function(e){if(void 0!==e)l()&&t(e);else if(r.oncePoll)r.oncePoll.once("poll",n);else if(r.onceBlock)r.onceBlock.once("block",n);else if(!s){if(c++,c>i)return void(l()&&o(new Error("retry limit reached")));let e=r.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<r.floor&&(e=r.floor),e>r.ceiling&&(e=r.ceiling),setTimeout(n,e)}return null}),(function(e){l()&&o(e)}))}()}))}var p=Object.freeze({__proto__:null,_fetchData:h,fetchJson:d,poll:f});exports._fetchData=h,exports.decode=o,exports.encode=n,exports.fetchJson=d,exports.lib_esm=p,exports.poll=f;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r=require("@ethersproject/bytes"),t=require("./id-e5478f9c.cjs");const e=new t.Logger("rlp/5.7.0");function o(r){const t=[];for(;r;)t.unshift(255&r),r>>=8;return t}function n(r,t,e){let o=0;for(let n=0;n<e;n++)o=256*o+r[t+n];return o}function s(t){if(Array.isArray(t)){let r=[];if(t.forEach((function(t){r=r.concat(s(t))})),r.length<=55)return r.unshift(192+r.length),r;const e=o(r.length);return e.unshift(247+e.length),e.concat(r)}r.isBytesLike(t)||e.throwArgumentError("RLP object must be BytesLike","object",t);const n=Array.prototype.slice.call(r.arrayify(t));if(1===n.length&&n[0]<=127)return n;if(n.length<=55)return n.unshift(128+n.length),n;const c=o(n.length);return c.unshift(183+c.length),c.concat(n)}function c(t){return r.hexlify(s(t))}function h(r,o,n,s){const c=[];for(;n<o+1+s;){const h=u(r,n);c.push(h.result),(n+=h.consumed)>o+1+s&&e.throwError("child data too short",t.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+s,result:c}}function u(o,s){if(0===o.length&&e.throwError("data too short",t.Logger.errors.BUFFER_OVERRUN,{}),o[s]>=248){const r=o[s]-247;s+1+r>o.length&&e.throwError("data short segment too short",t.Logger.errors.BUFFER_OVERRUN,{});const c=n(o,s+1,r);return s+1+r+c>o.length&&e.throwError("data long segment too short",t.Logger.errors.BUFFER_OVERRUN,{}),h(o,s,s+1+r,r+c)}if(o[s]>=192){const r=o[s]-192;return s+1+r>o.length&&e.throwError("data array too short",t.Logger.errors.BUFFER_OVERRUN,{}),h(o,s,s+1,r)}if(o[s]>=184){const c=o[s]-183;s+1+c>o.length&&e.throwError("data array too short",t.Logger.errors.BUFFER_OVERRUN,{});const h=n(o,s+1,c);s+1+c+h>o.length&&e.throwError("data array too short",t.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+c+h,result:r.hexlify(o.slice(s+1+c,s+1+c+h))}}if(o[s]>=128){const n=o[s]-128;s+1+n>o.length&&e.throwError("data too short",t.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+n,result:r.hexlify(o.slice(s+1,s+1+n))}}return{consumed:1,result:r.hexlify(o[s])}}function l(t){const o=r.arrayify(t),n=u(o,0);return n.consumed!==o.length&&e.throwArgumentError("invalid rlp data","data",t),n.result}var i=Object.freeze({__proto__:null,encode:c,decode:l});exports.decode=l,exports.encode=c,exports.lib_esm=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./index-
|
|
1
|
+
"use strict";var e=require("./index-3e706c23.cjs"),r=require("@ethersproject/providers"),t=require("@ethersproject/address");require("events");var n=require("@ethersproject/bytes"),i=require("./id-e5478f9c.cjs"),s=require("./typed-data-e5ba4465.cjs"),o=require("@ethersproject/abstract-signer"),a=require("@ethersproject/properties"),d=require("./index-ae69c0db.cjs");require("zustand"),require("@ethersproject/constants"),require("@ethersproject/contracts"),require("@ethersproject/transactions"),require("./__node-resolve_empty-f823f66f.cjs");class c extends o.Signer{constructor(e,r,t,n){super(),this._address=r,this._index=null!=t?t:0,this.provider=e,this.app=n}_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.__awaiter(this,void 0,void 0,(function*(){return Promise.resolve(t.getAddress(this._address))}))}signMessage(r){return e.__awaiter(this,void 0,void 0,(function*(){const t=e.getOwnerProvider(),s="string"==typeof r?i.toUtf8Bytes(r):r,o=yield this.getAddress();return yield t.send("personal_sign",[n.hexlify(s),o.toLowerCase()])}))}_signTypedData(r,t,n){var i,o;return e.__awaiter(this,void 0,void 0,(function*(){const a=e.getOwnerProvider(),d=yield s.TypedDataEncoder.resolveNames(r,t,n,(r=>e.__awaiter(this,void 0,void 0,(function*(){return yield a.resolveName(r)})))),c=null!==(o=null===(i=e.getCyberAccount())||void 0===i?void 0:i.ownerAddress)&&void 0!==o?o:"";return yield a.send("eth_signTypedData_v4",[c.toLowerCase(),JSON.stringify(s.TypedDataEncoder.getPayload(d.domain,t,d.value))])}))}signTransaction(r){return e.__awaiter(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}sendTransaction(r){return e.__awaiter(this,void 0,void 0,(function*(){const t=yield this.getChainId(),n=e.getCyberChain(this.app,t);return{hash:yield n.sendTransaction({to:r.to,value:r.value,data:r.data}).catch((r=>{if(r.name===e.ErrorType.SendTransactionError)throw console.error(r.shortMessage),r}))}}))}connect(e){return new c(null!=e?e:this.provider,this._address,this._index,this.app)}connectUnchecked(){return new c(this.provider,this._address,this._index,this.app)}}function h(e){if(e.error){const r=new Error(e.error.message);throw r.code=e.error.code,r.data=e.error.data,r}return e.result}exports.getIsCyber=e.getIsCyber,exports.default=function(n,i){return e.__awaiter(this,void 0,void 0,(function*(){const s=yield function({appName:n,appLogoUrl:i,rpcUrl:s,rpc:o,chainId:u,cyberParams:p}){return e.__awaiter(this,void 0,void 0,(function*(){if(!n||!i)throw new Error("appName and appLogoUrl is required.");if(!(null==p?void 0:p.appId))throw new Error("cyberParams.appId and appLogoUrl is required.");const{app:l,cyberAccount:v}=yield e.connect({appName:n,appLogoUrl:i,appId:null==p?void 0:p.appId});if(!v)throw new Error("cyberAccount is not valid.");const g=v.address;class w extends r.JsonRpcProvider{constructor(r,t){super(r,t),this.updateUpWalletConfig=r=>{const t=null==o?void 0:o[r];if(!e.supportChains.includes(r)||!t)throw new Error(`chainId ${r} not supported`);return this.chainId=r,t&&(this.rpcUrl=t),this.emit("chainChanged",`0x${r.toString(16)}`),{result:!0}},this.rpcUrl=r,this.chainId=u}getSigner(){return new c(_,g,0,l)}listAccounts(){return e.__awaiter(this,void 0,void 0,(function*(){return[g]}))}getNetwork(){return this.chainId?Promise.resolve({chainId:this.chainId,name:"unknown"}):super.getNetwork()}send(e,r){const t={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:a.deepCopy(t),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=d.fetchJson({url:this.rpcUrl},JSON.stringify(t),h).then((e=>(this.emit("debug",{action:"response",request:t,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:t,provider:this}),e}));return n&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}getAddress(){return Promise.resolve(t.getAddress(g))}}const _=new w(s,u);return _}))}(n);return s.on("connect",i.connect),s.on("disconnect",i.disconnect),s.on("accountsChanged",i.accountsChanged),s.on("chainChanged",i.chainChanged),s.on("message",i.message),s}))},exports.switchChain=function(r){var t;const n=r.addChainParameters.chainId,i="string"==typeof n&&(null==n?void 0:n.startsWith("0x"))?parseInt(n,16):Number(n);if(!e.supportChains.includes(i))throw new Error(`chainId ${i} not supported`);return null===(t=e.useWalletStore.getState().provider)||void 0===t?void 0:t.updateUpWalletConfig(i)};
|