@dodoex/wallet-web3 0.0.3-1 → 0.0.3-2

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 (113) hide show
  1. package/dist/_commonjsHelpers-70de2c37.js +1 -0
  2. package/dist/bn-16003306.js +1 -0
  3. package/dist/cjs/_commonjsHelpers-66ecbaf8.cjs +1 -0
  4. package/dist/cjs/bn-1bd77809.cjs +1 -0
  5. package/dist/cjs/elliptic-174586a6.cjs +1 -0
  6. package/dist/cjs/hash-121fdd2c.cjs +1 -0
  7. package/dist/cjs/index-23606273.cjs +1 -0
  8. package/dist/cjs/index-33e57d81.cjs +1 -0
  9. package/dist/cjs/index-5976e357.cjs +1 -0
  10. package/dist/cjs/index-6d7369f7.cjs +1 -0
  11. package/dist/cjs/index-a32c3cfa.cjs +22 -0
  12. package/dist/cjs/index-e0e60b3b.cjs +3 -0
  13. package/dist/cjs/index-e948d9e4.cjs +19 -0
  14. package/dist/cjs/index-f7522058.cjs +1 -0
  15. package/dist/cjs/index.cjs +1 -1
  16. package/dist/cjs/inherits-6d52d55b.cjs +1 -0
  17. package/dist/cjs/interface-6a2093d7.cjs +1 -0
  18. package/dist/cjs/node-ponyfill-c08c51bf.cjs +1 -0
  19. package/dist/cjs/portis-cf05b1f4.cjs +1 -0
  20. package/dist/cjs/provider-de4ee5b7.cjs +1 -0
  21. package/dist/cjs/providers/connector/safeGnosis/adapter.d.ts +1 -6
  22. package/dist/cjs/sha256-21fccd26.cjs +1 -0
  23. package/dist/cjs/sha3-499f6bea.cjs +10 -0
  24. package/dist/cjs/uAuth-075fec28.cjs +1 -0
  25. package/dist/cjs/walletConnect-58449a61.cjs +1 -0
  26. package/dist/cjs/walletLink-e3b39e1b.cjs +1 -0
  27. package/dist/elliptic-1100204f.js +1 -0
  28. package/dist/hash-4b8ad136.js +1 -0
  29. package/dist/index-5c16deff.js +1 -0
  30. package/dist/index-632fbf92.js +1 -0
  31. package/dist/index-6cdefd52.js +22 -0
  32. package/dist/index-822c6d78.js +1 -0
  33. package/dist/index-83293e8e.js +2 -0
  34. package/dist/index-9547c0cf.js +1 -0
  35. package/dist/index-e3ab6de5.js +1 -0
  36. package/dist/index-ecbe3d8d.js +19 -0
  37. package/dist/index.js +1 -1
  38. package/dist/inherits-e2363129.js +1 -0
  39. package/dist/interface-36a3c8cf.js +1 -0
  40. package/dist/node-ponyfill-bda9b4f4.js +1 -0
  41. package/dist/portis-b3fee0d6.js +1 -0
  42. package/dist/provider-30d55a46.js +1 -0
  43. package/dist/providers/connector/safeGnosis/adapter.d.ts +1 -6
  44. package/dist/sha256-8f7b3565.js +1 -0
  45. package/dist/sha3-a5661517.js +9 -0
  46. package/dist/uAuth-343d653d.js +1 -0
  47. package/dist/walletConnect-ea07b187.js +1 -0
  48. package/dist/walletLink-39bc8bdc.js +1 -0
  49. package/package.json +8 -8
  50. package/dist/cjs/index-1d035f96.cjs +0 -1
  51. package/dist/cjs/index-20589cad.cjs +0 -1
  52. package/dist/cjs/index-3c0f322c.cjs +0 -1
  53. package/dist/cjs/index-57e7ce01.cjs +0 -1
  54. package/dist/cjs/index-5f524b54.cjs +0 -1
  55. package/dist/cjs/index-809d42db.cjs +0 -1
  56. package/dist/cjs/index-9726ade3.cjs +0 -1
  57. package/dist/cjs/index-a53895dd.cjs +0 -1
  58. package/dist/cjs/index-b3bae54d.cjs +0 -1
  59. package/dist/cjs/index-b787ad60.cjs +0 -1
  60. package/dist/cjs/index-bd507185.cjs +0 -1
  61. package/dist/cjs/index-e43297ee.cjs +0 -1
  62. package/dist/cjs/portis-0d0ed336.cjs +0 -1
  63. package/dist/cjs/portis-139a9e4d.cjs +0 -1
  64. package/dist/cjs/portis-19c00eba.cjs +0 -1
  65. package/dist/cjs/portis-2053ea4b.cjs +0 -1
  66. package/dist/cjs/provider-216c4ecc.cjs +0 -1
  67. package/dist/cjs/provider-664da1b0.cjs +0 -1
  68. package/dist/cjs/provider-9bce34ab.cjs +0 -1
  69. package/dist/cjs/provider-a9b8a548.cjs +0 -1
  70. package/dist/cjs/uAuth-218d5a4e.cjs +0 -1
  71. package/dist/cjs/uAuth-384147c3.cjs +0 -1
  72. package/dist/cjs/uAuth-5d059de5.cjs +0 -1
  73. package/dist/cjs/uAuth-b52b01e0.cjs +0 -1
  74. package/dist/cjs/walletConnect-02bcbc5c.cjs +0 -1
  75. package/dist/cjs/walletConnect-712b3724.cjs +0 -1
  76. package/dist/cjs/walletConnect-9a4bbbc8.cjs +0 -1
  77. package/dist/cjs/walletConnect-b6ac4960.cjs +0 -1
  78. package/dist/cjs/walletLink-2cd8be6e.cjs +0 -1
  79. package/dist/cjs/walletLink-349e1bf5.cjs +0 -1
  80. package/dist/cjs/walletLink-92f211ff.cjs +0 -1
  81. package/dist/cjs/walletLink-f4cbd510.cjs +0 -1
  82. package/dist/index-4025ab08.js +0 -1
  83. package/dist/index-5ced3e7a.js +0 -1
  84. package/dist/index-677159b8.js +0 -1
  85. package/dist/index-6b9ad9a8.js +0 -1
  86. package/dist/index-6f08dc42.js +0 -1
  87. package/dist/index-829e82f9.js +0 -1
  88. package/dist/index-853b673b.js +0 -1
  89. package/dist/index-8dfaf647.js +0 -1
  90. package/dist/index-be16dd4e.js +0 -1
  91. package/dist/index-be47cca9.js +0 -1
  92. package/dist/index-c7eb0cf4.js +0 -1
  93. package/dist/index-fa3d2d50.js +0 -1
  94. package/dist/portis-32658178.js +0 -1
  95. package/dist/portis-5cb50e65.js +0 -1
  96. package/dist/portis-db858db8.js +0 -1
  97. package/dist/portis-fbb3c228.js +0 -1
  98. package/dist/provider-3fe99d2c.js +0 -1
  99. package/dist/provider-9ab2eb6e.js +0 -1
  100. package/dist/provider-e2314677.js +0 -1
  101. package/dist/provider-f7f5cb2b.js +0 -1
  102. package/dist/uAuth-64c3dda3.js +0 -1
  103. package/dist/uAuth-9f7c98e7.js +0 -1
  104. package/dist/uAuth-ddaae2b5.js +0 -1
  105. package/dist/uAuth-e4b5c839.js +0 -1
  106. package/dist/walletConnect-1a1a1062.js +0 -1
  107. package/dist/walletConnect-2b8f3354.js +0 -1
  108. package/dist/walletConnect-4c410280.js +0 -1
  109. package/dist/walletConnect-fb4a3e3c.js +0 -1
  110. package/dist/walletLink-5b9fdf98.js +0 -1
  111. package/dist/walletLink-98193680.js +0 -1
  112. package/dist/walletLink-986484a1.js +0 -1
  113. package/dist/walletLink-cf8da449.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";var e=require("stream"),t=require("http"),r=require("url"),o=require("./interface-6a2093d7.cjs"),n=require("https"),s=require("zlib"),i=require("./_commonjsHelpers-66ecbaf8.cjs"),u=require("@ethersproject/bytes");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(e),l=a(t),f=a(r),d=a(n),h=a(s);const p=c.default.Readable,y=Symbol("buffer"),b=Symbol("type");class m{constructor(){this[b]="";const e=arguments[0],t=arguments[1],r=[];let o=0;if(e){const t=e,n=Number(t.length);for(let e=0;e<n;e++){const n=t[e];let s;s=n instanceof Buffer?n:ArrayBuffer.isView(n)?Buffer.from(n.buffer,n.byteOffset,n.byteLength):n instanceof ArrayBuffer?Buffer.from(n):n instanceof m?n[y]:Buffer.from("string"==typeof n?n:String(n)),o+=s.length,r.push(s)}}this[y]=Buffer.concat(r);let n=t&&void 0!==t.type&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[b]=n)}get size(){return this[y].length}get type(){return this[b]}text(){return Promise.resolve(this[y].toString())}arrayBuffer(){const e=this[y],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new p;return e._read=function(){},e.push(this[y]),e.push(null),e}toString(){return"[object Blob]"}slice(){const e=this.size,t=arguments[0],r=arguments[1];let o,n;o=void 0===t?0:t<0?Math.max(e+t,0):Math.min(t,e),n=void 0===r?e:r<0?Math.max(e+r,0):Math.min(r,e);const s=Math.max(n-o,0),i=this[y].slice(o,o+s),u=new m([],{type:arguments[2]});return u[y]=i,u}}function g(e,t,r){Error.call(this,e),this.message=e,this.type=t,r&&(this.code=this.errno=r.code),Error.captureStackTrace(this,this.constructor)}let w;Object.defineProperties(m.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(m.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),g.prototype=Object.create(Error.prototype),g.prototype.constructor=g,g.prototype.name="FetchError";try{w=require("encoding").convert}catch(e){}const v=Symbol("Body internals"),E=c.default.PassThrough;function S(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.size;let n=void 0===o?0:o;var s=r.timeout;let i=void 0===s?0:s;null==e?e=null:j(e)?e=Buffer.from(e.toString()):O(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof c.default||(e=Buffer.from(String(e)))),this[v]={body:e,disturbed:!1,error:null},this.size=n,this.timeout=i,e instanceof c.default&&e.on("error",(function(e){const r="AbortError"===e.name?e:new g(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[v].error=r}))}function T(){var e=this;if(this[v].disturbed)return S.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[v].disturbed=!0,this[v].error)return S.Promise.reject(this[v].error);let t=this.body;if(null===t)return S.Promise.resolve(Buffer.alloc(0));if(O(t)&&(t=t.stream()),Buffer.isBuffer(t))return S.Promise.resolve(t);if(!(t instanceof c.default))return S.Promise.resolve(Buffer.alloc(0));let r=[],o=0,n=!1;return new S.Promise((function(s,i){let u;e.timeout&&(u=setTimeout((function(){n=!0,i(new g(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(n=!0,i(t)):i(new g(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!n&&null!==t){if(e.size&&o+t.length>e.size)return n=!0,void i(new g(`content size at ${e.url} over limit: ${e.size}`,"max-size"));o+=t.length,r.push(t)}})),t.on("end",(function(){if(!n){clearTimeout(u);try{s(Buffer.concat(r,o))}catch(t){i(new g(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function j(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function O(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function R(e){let t,r,o=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof c.default&&"function"!=typeof o.getBoundary&&(t=new E,r=new E,o.pipe(t),o.pipe(r),e[v].body=t,o=r),o}function x(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":j(e)?"application/x-www-form-urlencoded;charset=UTF-8":O(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof c.default?null:"text/plain;charset=UTF-8"}function B(e){const t=e.body;return null===t?0:O(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}S.prototype={get body(){return this[v].body},get bodyUsed(){return this[v].disturbed},arrayBuffer(){return T.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return T.call(this).then((function(t){return Object.assign(new m([],{type:e.toLowerCase()}),{[y]:t})}))},json(){var e=this;return T.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return S.Promise.reject(new g(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return T.call(this).then((function(e){return e.toString()}))},buffer(){return T.call(this)},textConverted(){var e=this;return T.call(this).then((function(t){return function(e,t){if("function"!=typeof w)throw new Error("The package `encoding` must be installed to use the textConverted() function");const r=t.get("content-type");let o,n,s="utf-8";r&&(o=/charset=([^;]*)/i.exec(r));n=e.slice(0,1024).toString(),!o&&n&&(o=/<meta.+?charset=(['"])(.+?)\1/i.exec(n));!o&&n&&(o=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(n),o||(o=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(n),o&&o.pop()),o&&(o=/charset=(.*)/i.exec(o.pop())));!o&&n&&(o=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(n));o&&(s=o.pop(),"gb2312"!==s&&"gbk"!==s||(s="gb18030"));return w(e,"UTF-8",s).toString()}(t,e.headers)}))}},Object.defineProperties(S.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),S.mixIn=function(e){for(const t of Object.getOwnPropertyNames(S.prototype))if(!(t in e)){const r=Object.getOwnPropertyDescriptor(S.prototype,t);Object.defineProperty(e,t,r)}},S.Promise=global.Promise;const P=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,L=/[^\t\x20-\x7e\x80-\xff]/;function U(e){if(e=`${e}`,P.test(e)||""===e)throw new TypeError(`${e} is not a legal HTTP header name`)}function A(e){if(e=`${e}`,L.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function $(e,t){t=t.toLowerCase();for(const r in e)if(r.toLowerCase()===t)return r}const _=Symbol("map");class C{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[_]=Object.create(null),e instanceof C){const t=e.raw(),r=Object.keys(t);for(const e of r)for(const r of t[e])this.append(e,r)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const r=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");r.push(Array.from(t))}for(const e of r){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const r=e[t];this.append(t,r)}}}}get(e){U(e=`${e}`);const t=$(this[_],e);return void 0===t?null:this[_][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=k(this),o=0;for(;o<r.length;){var n=r[o];const s=n[0],i=n[1];e.call(t,i,s,this),r=k(this),o++}}set(e,t){t=`${t}`,U(e=`${e}`),A(t);const r=$(this[_],e);this[_][void 0!==r?r:e]=[t]}append(e,t){t=`${t}`,U(e=`${e}`),A(t);const r=$(this[_],e);void 0!==r?this[_][r].push(t):this[_][e]=[t]}has(e){return U(e=`${e}`),void 0!==$(this[_],e)}delete(e){U(e=`${e}`);const t=$(this[_],e);void 0!==t&&delete this[_][t]}raw(){return this[_]}keys(){return F(this,"key")}values(){return F(this,"value")}[Symbol.iterator](){return F(this,"key+value")}}function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";return Object.keys(e[_]).sort().map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[_][t].join(", ")}:function(t){return[t.toLowerCase(),e[_][t].join(", ")]})}C.prototype.entries=C.prototype[Symbol.iterator],Object.defineProperty(C.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(C.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const z=Symbol("internal");function F(e,t){const r=Object.create(q);return r[z]={target:e,kind:t,index:0},r}const q=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==q)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[z];const t=e.target,r=e.kind,o=e.index,n=k(t,r);return o>=n.length?{value:void 0,done:!0}:(this[z].index=o+1,{value:n[o],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function H(e){const t=Object.assign({__proto__:null},e[_]),r=$(e[_],"Host");return void 0!==r&&(t[r]=t[r][0]),t}Object.defineProperty(q,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const N=Symbol("Response internals"),V=l.default.STATUS_CODES;class I{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};S.call(this,e,t);const r=t.status||200,o=new C(t.headers);if(null!=e&&!o.has("Content-Type")){const t=x(e);t&&o.append("Content-Type",t)}this[N]={url:t.url,status:r,statusText:t.statusText||V[r],headers:o,counter:t.counter}}get url(){return this[N].url||""}get status(){return this[N].status}get ok(){return this[N].status>=200&&this[N].status<300}get redirected(){return this[N].counter>0}get statusText(){return this[N].statusText}get headers(){return this[N].headers}clone(){return new I(R(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}S.mixIn(I.prototype),Object.defineProperties(I.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(I.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const M=Symbol("Request internals"),D=f.default.URL||o.publicApi.URL,G=f.default.parse,Z=f.default.format;function K(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(e)&&(e=new D(e).toString()),G(e)}const Y="destroy"in c.default.Readable.prototype;function J(e){return"object"==typeof e&&"object"==typeof e[M]}class W{constructor(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};J(e)?t=K(e.url):(t=e&&e.href?K(e.href):K(`${e}`),e={});let o=r.method||e.method||"GET";if(o=o.toUpperCase(),(null!=r.body||J(e)&&null!==e.body)&&("GET"===o||"HEAD"===o))throw new TypeError("Request with GET/HEAD method cannot have body");let n=null!=r.body?r.body:J(e)&&null!==e.body?R(e):null;S.call(this,n,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});const s=new C(r.headers||e.headers||{});if(null!=n&&!s.has("Content-Type")){const e=x(n);e&&s.append("Content-Type",e)}let i=J(e)?e.signal:null;if("signal"in r&&(i=r.signal),null!=i&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(i))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[M]={method:o,redirect:r.redirect||e.redirect||"follow",headers:s,parsedURL:t,signal:i},this.follow=void 0!==r.follow?r.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===e.compress||e.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent}get method(){return this[M].method}get url(){return Z(this[M].parsedURL)}get headers(){return this[M].headers}get redirect(){return this[M].redirect}get signal(){return this[M].signal}clone(){return new W(this)}}function Q(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}S.mixIn(W.prototype),Object.defineProperty(W.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(W.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),Q.prototype=Object.create(Error.prototype),Q.prototype.constructor=Q,Q.prototype.name="AbortError";const X=f.default.URL||o.publicApi.URL,ee=c.default.PassThrough;function te(e,t){if(!te.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return S.Promise=te.Promise,new te.Promise((function(r,o){const n=new W(e,t),s=function(e){const t=e[M].parsedURL,r=new C(e[M].headers);if(r.has("Accept")||r.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof c.default.Readable&&!Y)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let o=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(o="0"),null!=e.body){const t=B(e);"number"==typeof t&&(o=String(t))}o&&r.set("Content-Length",o),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let n=e.agent;return"function"==typeof n&&(n=n(t)),r.has("Connection")||n||r.set("Connection","close"),Object.assign({},t,{method:e.method,headers:H(r),agent:n})}(n),i=("https:"===s.protocol?d.default:l.default).request,u=n.signal;let a=null;const f=function(){let e=new Q("The user aborted a request.");o(e),n.body&&n.body instanceof c.default.Readable&&re(n.body,e),a&&a.body&&a.body.emit("error",e)};if(u&&u.aborted)return void f();const p=function(){f(),m()},y=i(s);let b;function m(){y.abort(),u&&u.removeEventListener("abort",p),clearTimeout(b)}u&&u.addEventListener("abort",p),n.timeout&&y.once("socket",(function(e){b=setTimeout((function(){o(new g(`network timeout at: ${n.url}`,"request-timeout")),m()}),n.timeout)})),y.on("error",(function(e){o(new g(`request to ${n.url} failed, reason: ${e.message}`,"system",e)),a&&a.body&&re(a.body,e),m()})),function(e,t){let r;e.on("socket",(function(e){r=e})),e.on("response",(function(e){const o=e.headers;"chunked"!==o["transfer-encoding"]||o["content-length"]||e.once("close",(function(e){if(r.listenerCount("data")>0&&!e){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",t(e)}}))}))}(y,(function(e){u&&u.aborted||a&&a.body&&re(a.body,e)})),parseInt(process.version.substring(1))<14&&y.on("socket",(function(e){e.addListener("close",(function(t){const r=e.listenerCount("data")>0;if(a&&r&&!t&&(!u||!u.aborted)){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",a.body.emit("error",e)}}))})),y.on("response",(function(e){clearTimeout(b);const t=function(e){const t=new C;for(const r of Object.keys(e))if(!P.test(r))if(Array.isArray(e[r]))for(const o of e[r])L.test(o)||(void 0===t[_][r]?t[_][r]=[o]:t[_][r].push(o));else L.test(e[r])||(t[_][r]=[e[r]]);return t}(e.headers);if(te.isRedirect(e.statusCode)){const i=t.get("Location");let u=null;try{u=null===i?null:new X(i,n.url).toString()}catch(e){if("manual"!==n.redirect)return o(new g(`uri requested responds with an invalid redirect URL: ${i}`,"invalid-redirect")),void m()}switch(n.redirect){case"error":return o(new g(`uri requested responds with a redirect, redirect mode is set to error: ${n.url}`,"no-redirect")),void m();case"manual":if(null!==u)try{t.set("Location",u)}catch(e){o(e)}break;case"follow":if(null===u)break;if(n.counter>=n.follow)return o(new g(`maximum redirect reached at: ${n.url}`,"max-redirect")),void m();const i={headers:new C(n.headers),follow:n.follow,counter:n.counter+1,agent:n.agent,compress:n.compress,method:n.method,body:n.body,signal:n.signal,timeout:n.timeout,size:n.size};if(!function(e,t){const r=new X(t).hostname,o=new X(e).hostname;return r===o||"."===r[r.length-o.length-1]&&r.endsWith(o)}(n.url,u)||(s=n.url,new X(u).protocol!==new X(s).protocol))for(const e of["authorization","www-authenticate","cookie","cookie2"])i.headers.delete(e);return 303!==e.statusCode&&n.body&&null===B(n)?(o(new g("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void m()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==n.method)||(i.method="GET",i.body=void 0,i.headers.delete("content-length")),r(te(new W(u,i))),void m())}}var s;e.once("end",(function(){u&&u.removeEventListener("abort",p)}));let i=e.pipe(new ee);const c={url:n.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:n.size,timeout:n.timeout,counter:n.counter},l=t.get("Content-Encoding");if(!n.compress||"HEAD"===n.method||null===l||204===e.statusCode||304===e.statusCode)return a=new I(i,c),void r(a);const f={flush:h.default.Z_SYNC_FLUSH,finishFlush:h.default.Z_SYNC_FLUSH};if("gzip"==l||"x-gzip"==l)return i=i.pipe(h.default.createGunzip(f)),a=new I(i,c),void r(a);if("deflate"==l||"x-deflate"==l){const t=e.pipe(new ee);return t.once("data",(function(e){i=8==(15&e[0])?i.pipe(h.default.createInflate()):i.pipe(h.default.createInflateRaw()),a=new I(i,c),r(a)})),void t.on("end",(function(){a||(a=new I(i,c),r(a))}))}if("br"==l&&"function"==typeof h.default.createBrotliDecompress)return i=i.pipe(h.default.createBrotliDecompress()),a=new I(i,c),void r(a);a=new I(i,c),r(a)})),function(e,t){const r=t.body;null===r?e.end():O(r)?r.stream().pipe(e):Buffer.isBuffer(r)?(e.write(r),e.end()):r.pipe(e)}(y,n)}))}function re(e,t){e.destroy?e.destroy(t):(e.emit("error",t),e.end())}te.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},te.Promise=global.Promise;var oe=Object.freeze({__proto__:null,default:te,Headers:C,Request:W,Response:I,FetchError:g}),ne=i.getAugmentedNamespace(oe);const se=new o.Logger("rlp/5.7.0");function ie(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function ue(e,t,r){let o=0;for(let n=0;n<r;n++)o=256*o+e[t+n];return o}function ae(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(ae(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=ie(t.length);return r.unshift(247+r.length),r.concat(t)}u.isBytesLike(e)||se.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call(u.arrayify(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=ie(t.length);return r.unshift(183+r.length),r.concat(t)}function ce(e){return u.hexlify(ae(e))}function le(e,t,r,n){const s=[];for(;r<t+1+n;){const i=fe(e,r);s.push(i.result),(r+=i.consumed)>t+1+n&&se.throwError("child data too short",o.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:s}}function fe(e,t){if(0===e.length&&se.throwError("data too short",o.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&se.throwError("data short segment too short",o.Logger.errors.BUFFER_OVERRUN,{});const n=ue(e,t+1,r);return t+1+r+n>e.length&&se.throwError("data long segment too short",o.Logger.errors.BUFFER_OVERRUN,{}),le(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&se.throwError("data array too short",o.Logger.errors.BUFFER_OVERRUN,{}),le(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&se.throwError("data array too short",o.Logger.errors.BUFFER_OVERRUN,{});const n=ue(e,t+1,r);t+1+r+n>e.length&&se.throwError("data array too short",o.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:u.hexlify(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&se.throwError("data too short",o.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:u.hexlify(e.slice(t+1,t+1+r))}}return{consumed:1,result:u.hexlify(e[t])}}function de(e){const t=u.arrayify(e),r=fe(t,0);return r.consumed!==t.length&&se.throwArgumentError("invalid rlp data","data",e),r.result}var he=Object.freeze({__proto__:null,encode:ce,decode:de});exports.decode=de,exports.encode=ce,exports.index=he,exports.require$$0=ne;
@@ -0,0 +1 @@
1
+ "use strict";var r=function(r){if("string"!=typeof r)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof r+", while checking isHexPrefixed.");return"0x"===r.slice(0,2)},t=r,e=function(r){return"string"!=typeof r?r:t(r)?r.slice(2):r};function n(r){var t=r;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function i(r){return"0x"+r.toString(16)}var o,f,u,a,s,c={arrayContainsArray:function(r,t,e){if(!0!==Array.isArray(r))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof r+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(e)?"some":"every"]((function(t){return r.indexOf(t)>=0}))},intToBuffer:function(r){var t=i(r);return new Buffer(n(t.slice(2)),"hex")},getBinarySize:function(r){if("string"!=typeof r)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof r+"'.");return Buffer.byteLength(r,"utf8")},isHexPrefixed:r,stripHexPrefix:e,padToEven:n,intToHex:i,fromAscii:function(r){for(var t="",e=0;e<r.length;e++){var n=r.charCodeAt(e).toString(16);t+=n.length<2?"0"+n:n}return"0x"+t},fromUtf8:function(r){return"0x"+n(new Buffer(r,"utf8").toString("hex")).replace(/^0+|0+$/g,"")},toAscii:function(r){var t="",e=0,n=r.length;for("0x"===r.substring(0,2)&&(e=2);e<n;e+=2){var i=parseInt(r.substr(e,2),16);t+=String.fromCharCode(i)}return t},toUtf8:function(r){return new Buffer(n(e(r).replace(/^0+|0+$/g,"")),"hex").toString("utf8")},getKeys:function(r,t,e){if(!Array.isArray(r))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+typeof r+"'");if("string"!=typeof t)throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+typeof t+"'.");for(var n=[],i=0;i<r.length;i++){var o=r[i][t];if(e&&!o)o="";else if("string"!=typeof o)throw new Error("invalid abi");n.push(o)}return n},isHexString:function(r,t){return!("string"!=typeof r||!r.match(/^0x[0-9A-Fa-f]*$/))&&(!t||r.length===2+2*t)}},y={};function p(){if(f)return o;var r,t;f=1;var e,n={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function i(t){throw{name:"SyntaxError",message:t,at:r,text:e}}function u(n){return n&&n!==t&&i("Expected '"+n+"' instead of '"+t+"'"),t=e.charAt(r),r+=1,t}function a(){var r,e="";for("-"===t&&(e="-",u("-"));t>="0"&&t<="9";)e+=t,u();if("."===t)for(e+=".";u()&&t>="0"&&t<="9";)e+=t;if("e"===t||"E"===t)for(e+=t,u(),"-"!==t&&"+"!==t||(e+=t,u());t>="0"&&t<="9";)e+=t,u();return r=Number(e),isFinite(r)||i("Bad number"),r}function s(){var r,e,o,f="";if('"'===t)for(;u();){if('"'===t)return u(),f;if("\\"===t)if(u(),"u"===t){for(o=0,e=0;e<4&&(r=parseInt(u(),16),isFinite(r));e+=1)o=16*o+r;f+=String.fromCharCode(o)}else{if("string"!=typeof n[t])break;f+=n[t]}else f+=t}i("Bad string")}function c(){for(;t&&t<=" ";)u()}function y(){switch(c(),t){case"{":return function(){var r,e={};if("{"===t){if(u("{"),c(),"}"===t)return u("}"),e;for(;t;){if(r=s(),c(),u(":"),Object.prototype.hasOwnProperty.call(e,r)&&i('Duplicate key "'+r+'"'),e[r]=y(),c(),"}"===t)return u("}"),e;u(","),c()}}i("Bad object")}();case"[":return function(){var r=[];if("["===t){if(u("["),c(),"]"===t)return u("]"),r;for(;t;){if(r.push(y()),c(),"]"===t)return u("]"),r;u(","),c()}}i("Bad array")}();case'"':return s();case"-":return a();default:return t>="0"&&t<="9"?a():function(){switch(t){case"t":return u("t"),u("r"),u("u"),u("e"),!0;case"f":return u("f"),u("a"),u("l"),u("s"),u("e"),!1;case"n":return u("n"),u("u"),u("l"),u("l"),null;default:i("Unexpected '"+t+"'")}}()}}return o=function(n,o){var f;return e=n,r=0,t=" ",f=y(),c(),t&&i("Syntax error"),"function"==typeof o?function r(t,e){var n,i,f=t[e];if(f&&"object"==typeof f)for(n in y)Object.prototype.hasOwnProperty.call(f,n)&&(void 0===(i=r(f,n))?delete f[n]:f[n]=i);return o.call(t,e,f)}({"":f},""):f}}function l(){if(a)return u;a=1;var r,t,e,n=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function o(r){return n.lastIndex=0,n.test(r)?'"'+r.replace(n,(function(r){var t=i[r];return"string"==typeof t?t:"\\u"+("0000"+r.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+r+'"'}function f(n,i){var u,a,s,c,y,p=r,l=i[n];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(n)),"function"==typeof e&&(l=e.call(i,n,l)),typeof l){case"string":return o(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(r+=t,y=[],"[object Array]"===Object.prototype.toString.apply(l)){for(c=l.length,u=0;u<c;u+=1)y[u]=f(u,l)||"null";return s=0===y.length?"[]":r?"[\n"+r+y.join(",\n"+r)+"\n"+p+"]":"["+y.join(",")+"]",r=p,s}if(e&&"object"==typeof e)for(c=e.length,u=0;u<c;u+=1)"string"==typeof(a=e[u])&&(s=f(a,l))&&y.push(o(a)+(r?": ":":")+s);else for(a in l)Object.prototype.hasOwnProperty.call(l,a)&&(s=f(a,l))&&y.push(o(a)+(r?": ":":")+s);return s=0===y.length?"{}":r?"{\n"+r+y.join(",\n"+r)+"\n"+p+"}":"{"+y.join(",")+"}",r=p,s}}return u=function(n,i,o){var u;if(r="",t="","number"==typeof o)for(u=0;u<o;u+=1)t+=" ";else"string"==typeof o&&(t=o);if(e=i,i&&"function"!=typeof i&&("object"!=typeof i||"number"!=typeof i.length))throw new Error("JSON.stringify");return f("",{"":n})}}var g="undefined"!=typeof JSON?JSON:(s||(s=1,y.parse=p(),y.stringify=l()),y),h=Array.isArray||function(r){return"[object Array]"==={}.toString.call(r)},v=Object.keys||function(r){var t=Object.prototype.hasOwnProperty||function(){return!0},e=[];for(var n in r)t.call(r,n)&&e.push(n);return e};exports.jsonStableStringify=function(r,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var e=t.space||"";"number"==typeof e&&(e=Array(e+1).join(" "));var n,i="boolean"==typeof t.cycles&&t.cycles,o=t.replacer||function(r,t){return t},f=t.cmp&&(n=t.cmp,function(r){return function(t,e){var i={key:t,value:r[t]},o={key:e,value:r[e]};return n(i,o)}}),u=[];return function r(t,n,a,s){var c=e?"\n"+new Array(s+1).join(e):"",y=e?": ":":";if(a&&a.toJSON&&"function"==typeof a.toJSON&&(a=a.toJSON()),void 0!==(a=o.call(t,n,a))){if("object"!=typeof a||null===a)return g.stringify(a);if(h(a)){for(var p=[],l=0;l<a.length;l++){var b=r(a,l,a[l],s+1)||g.stringify(null);p.push(c+e+b)}return"["+p.join(",")+c+"]"}if(-1!==u.indexOf(a)){if(i)return g.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}u.push(a);var d=v(a).sort(f&&f(a));for(p=[],l=0;l<d.length;l++){var w=r(a,n=d[l],a[n],s+1);if(w){var x=g.stringify(n)+y+w;p.push(c+e+x)}}return u.splice(u.indexOf(a),1),"{"+p.join(",")+c+"}"}}({"":r},"",r,0)},exports.lib=c;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./_commonjsHelpers-66ecbaf8.cjs");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=r(require("events")),o={},n={},s={};Object.defineProperty(s,"__esModule",{value:!0}),s.getUniqueId=void 0;const i=4294967295;let a=Math.floor(Math.random()*i);s.getUniqueId=function(){return a=(a+1)%i,a},Object.defineProperty(n,"__esModule",{value:!0}),n.createIdRemapMiddleware=void 0;const d=s;n.createIdRemapMiddleware=function(){return(e,r,t,o)=>{const n=e.id,s=d.getUniqueId();e.id=s,r.id=s,t((t=>{e.id=n,r.id=n,t()}))}};var c={};Object.defineProperty(c,"__esModule",{value:!0}),c.createAsyncMiddleware=void 0,c.createAsyncMiddleware=function(e){return async(r,t,o,n)=>{let s;const i=new Promise((e=>{s=e}));let a=null,d=!1;const c=async()=>{d=!0,o((e=>{a=e,s()})),await i};try{await e(r,t,c),d?(await i,a(null)):n(null)}catch(e){a?a(e):n(e)}}};var u={};Object.defineProperty(u,"__esModule",{value:!0}),u.createScaffoldMiddleware=void 0,u.createScaffoldMiddleware=function(e){return(r,t,o,n)=>{const s=e[r.method];return void 0===s?o():"function"==typeof s?s(r,t,o,n):(t.result=s,n())}};var l={},f={};Object.defineProperty(f,"__esModule",{value:!0});const p=t.default;function h(e,r,t){try{Reflect.apply(e,r,t)}catch(e){setTimeout((()=>{throw e}))}}class m extends p.EventEmitter{emit(e,...r){let t="error"===e;const o=this._events;if(void 0!==o)t=t&&void 0===o.error;else if(!t)return!1;if(t){let e;if(r.length>0&&([e]=r),e instanceof Error)throw e;const t=new Error("Unhandled error."+(e?` (${e.message})`:""));throw t.context=e,t}const n=o[e];if(void 0===n)return!1;if("function"==typeof n)h(n,this,r);else{const e=n.length,t=function(e){const r=e.length,t=new Array(r);for(let o=0;o<r;o+=1)t[o]=e[o];return t}(n);for(let o=0;o<e;o+=1)h(t[o],this,r)}return!0}}f.default=m;var g={},v={},y=j;j.default=j,j.stable=C,j.stableStringify=C;var E="[...]",b="[Circular]",w=[],_=[];function R(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function j(e,r,t,o){var n;void 0===o&&(o=R()),O(e,"",0,[],void 0,0,o);try{n=0===_.length?JSON.stringify(e,r,t):JSON.stringify(e,N(r),t)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==w.length;){var s=w.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return n}function P(e,r,t,o){var n=Object.getOwnPropertyDescriptor(o,t);void 0!==n.get?n.configurable?(Object.defineProperty(o,t,{value:e}),w.push([o,t,r,n])):_.push([r,t,e]):(o[t]=e,w.push([o,t,r]))}function O(e,r,t,o,n,s,i){var a;if(s+=1,"object"==typeof e&&null!==e){for(a=0;a<o.length;a++)if(o[a]===e)return void P(b,e,r,n);if(void 0!==i.depthLimit&&s>i.depthLimit)return void P(E,e,r,n);if(void 0!==i.edgesLimit&&t+1>i.edgesLimit)return void P(E,e,r,n);if(o.push(e),Array.isArray(e))for(a=0;a<e.length;a++)O(e[a],a,a,o,e,s,i);else{var d=Object.keys(e);for(a=0;a<d.length;a++){var c=d[a];O(e[c],c,a,o,e,s,i)}}o.pop()}}function M(e,r){return e<r?-1:e>r?1:0}function C(e,r,t,o){void 0===o&&(o=R());var n,s=S(e,"",0,[],void 0,0,o)||e;try{n=0===_.length?JSON.stringify(s,r,t):JSON.stringify(s,N(r),t)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==w.length;){var i=w.pop();4===i.length?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return n}function S(e,r,t,o,n,s,i){var a;if(s+=1,"object"==typeof e&&null!==e){for(a=0;a<o.length;a++)if(o[a]===e)return void P(b,e,r,n);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==i.depthLimit&&s>i.depthLimit)return void P(E,e,r,n);if(void 0!==i.edgesLimit&&t+1>i.edgesLimit)return void P(E,e,r,n);if(o.push(e),Array.isArray(e))for(a=0;a<e.length;a++)S(e[a],a,a,o,e,s,i);else{var d={},c=Object.keys(e).sort(M);for(a=0;a<c.length;a++){var u=c[a];S(e[u],u,a,o,e,s,i),d[u]=e[u]}if(void 0===n)return d;w.push([n,r,e]),n[r]=d}o.pop()}}function N(e){return e=void 0!==e?e:function(e,r){return r},function(r,t){if(_.length>0)for(var o=0;o<_.length;o++){var n=_[o];if(n[1]===r&&n[0]===t){t=n[2],_.splice(o,1);break}}return e.call(this,r,t)}}Object.defineProperty(v,"__esModule",{value:!0}),v.EthereumProviderError=v.EthereumRpcError=void 0;const A=y;class I extends Error{constructor(e,r,t){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string.');super(r),this.code=e,void 0!==t&&(this.data=t)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return A.default(this.serialize(),q,2)}}v.EthereumRpcError=I;function q(e,r){if("[Circular]"!==r)return r}v.EthereumProviderError=class extends I{constructor(e,r,t){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,t)}};var J={},x={};Object.defineProperty(x,"__esModule",{value:!0}),x.errorValues=x.errorCodes=void 0,x.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},x.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const r=x,t=v,o=r.errorCodes.rpc.internal,n="Unspecified error message. This is a bug, please report it.",s={code:o,message:i(o)};function i(t,o=n){if(Number.isInteger(t)){const o=t.toString();if(u(r.errorValues,o))return r.errorValues[o].message;if(d(t))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return o}function a(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!r.errorValues[t]||!!d(e)}function d(e){return e>=-32099&&e<=-32e3}function c(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function u(e,r){return Object.prototype.hasOwnProperty.call(e,r)}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=i,e.isValidCode=a,e.serializeError=function(e,{fallbackError:r=s,shouldIncludeStack:o=!1}={}){var n,d;if(!r||!Number.isInteger(r.code)||"string"!=typeof r.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof t.EthereumRpcError)return e.serialize();const l={};if(e&&"object"==typeof e&&!Array.isArray(e)&&u(e,"code")&&a(e.code)){const r=e;l.code=r.code,r.message&&"string"==typeof r.message?(l.message=r.message,u(r,"data")&&(l.data=r.data)):(l.message=i(l.code),l.data={originalError:c(e)})}else{l.code=r.code;const t=null===(n=e)||void 0===n?void 0:n.message;l.message=t&&"string"==typeof t?t:r.message,l.data={originalError:c(e)}}const f=null===(d=e)||void 0===d?void 0:d.stack;return o&&e&&f&&"string"==typeof f&&(l.stack=f),l}}(J);var F={};Object.defineProperty(F,"__esModule",{value:!0}),F.ethErrors=void 0;const z=v,k=J,G=x;function T(e,r){const[t,o]=U(r);return new z.EthereumRpcError(e,t||k.getMessageFromCode(e),o)}function L(e,r){const[t,o]=U(r);return new z.EthereumProviderError(e,t||k.getMessageFromCode(e),o)}function U(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:r,data:t}=e;if(r&&"string"!=typeof r)throw new Error("Must specify string message.");return[r||void 0,t]}}return[]}F.ethErrors={rpc:{parse:e=>T(G.errorCodes.rpc.parse,e),invalidRequest:e=>T(G.errorCodes.rpc.invalidRequest,e),invalidParams:e=>T(G.errorCodes.rpc.invalidParams,e),methodNotFound:e=>T(G.errorCodes.rpc.methodNotFound,e),internal:e=>T(G.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:r}=e;if(!Number.isInteger(r)||r>-32005||r<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return T(r,e)},invalidInput:e=>T(G.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>T(G.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>T(G.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>T(G.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>T(G.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>T(G.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>L(G.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>L(G.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>L(G.errorCodes.provider.unsupportedMethod,e),disconnected:e=>L(G.errorCodes.provider.disconnected,e),chainDisconnected:e=>L(G.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:r,message:t,data:o}=e;if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string');return new z.EthereumProviderError(r,t,o)}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const r=v;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return r.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return r.EthereumProviderError}});const t=J;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return t.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return t.getMessageFromCode}});const o=F;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return o.ethErrors}});const n=x;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return n.errorCodes}})}(g);var V=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l,"__esModule",{value:!0}),l.JsonRpcEngine=void 0;const H=V(f),$=g;class D extends H.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&"function"!=typeof r)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,t,o)=>{try{const[n,s,i]=await D._runAllMiddleware(e,r,this._middleware);return s?(await D._runReturnHandlers(i),o(n)):t((async e=>{try{await D._runReturnHandlers(i)}catch(r){return e(r)}return e()}))}catch(e){return o(e)}}}async _handleBatch(e,r){try{const t=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,t):t}catch(e){if(r)return r(e);throw e}}_promiseHandle(e){return new Promise((r=>{this._handle(e,((e,t)=>{r(t)}))}))}async _handle(e,r){if(!e||Array.isArray(e)||"object"!=typeof e){const t=new $.EthereumRpcError($.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof e,{request:e});return r(t,{id:void 0,jsonrpc:"2.0",error:t})}if("string"!=typeof e.method){const t=new $.EthereumRpcError($.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof e.method,{request:e});return r(t,{id:e.id,jsonrpc:"2.0",error:t})}const t=Object.assign({},e),o={id:t.id,jsonrpc:t.jsonrpc};let n=null;try{await this._processRequest(t,o)}catch(e){n=e}return n&&(delete o.result,o.error||(o.error=$.serializeError(n))),r(n,o)}async _processRequest(e,r){const[t,o,n]=await D._runAllMiddleware(e,r,this._middleware);if(D._checkForCompletion(e,r,o),await D._runReturnHandlers(n),t)throw t}static async _runAllMiddleware(e,r,t){const o=[];let n=null,s=!1;for(const i of t)if([n,s]=await D._runMiddleware(e,r,i,o),s)break;return[n,s,o.reverse()]}static _runMiddleware(e,r,t,o){return new Promise((n=>{const s=e=>{const t=e||r.error;t&&(r.error=$.serializeError(t)),n([t,!0])},i=t=>{r.error?s(r.error):(t&&("function"!=typeof t&&s(new $.EthereumRpcError($.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof t}" for request:\n${B(e)}`,{request:e})),o.push(t)),n([null,!1]))};try{t(e,r,i,s)}catch(e){s(e)}}))}static async _runReturnHandlers(e){for(const r of e)await new Promise(((e,t)=>{r((r=>r?t(r):e()))}))}static _checkForCompletion(e,r,t){if(!("result"in r)&&!("error"in r))throw new $.EthereumRpcError($.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:\n${B(e)}`,{request:e});if(!t)throw new $.EthereumRpcError($.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:\n${B(e)}`,{request:e})}}function B(e){return JSON.stringify(e,null,2)}l.JsonRpcEngine=D;var X={};Object.defineProperty(X,"__esModule",{value:!0}),X.mergeMiddleware=void 0;const K=l;X.mergeMiddleware=function(e){const r=new K.JsonRpcEngine;return e.forEach((e=>r.push(e))),r.asMiddleware()},function(r){var t=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t),Object.defineProperty(e,o,{enumerable:!0,get:function(){return r[t]}})}:function(e,r,t,o){void 0===o&&(o=t),e[o]=r[t]}),o=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,r){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(r,o)||t(r,e,o)};Object.defineProperty(r,"__esModule",{value:!0}),o(n,r),o(c,r),o(u,r),o(s,r),o(l,r),o(X,r)}(o);const Q=(e,r)=>function(){const t=r.promiseModule,o=new Array(arguments.length);for(let e=0;e<arguments.length;e++)o[e]=arguments[e];return new t(((t,n)=>{r.errorFirst?o.push((function(e,o){if(r.multiArgs){const r=new Array(arguments.length-1);for(let e=1;e<arguments.length;e++)r[e-1]=arguments[e];e?(r.unshift(e),n(r)):t(r)}else e?n(e):t(o)})):o.push((function(e){if(r.multiArgs){const e=new Array(arguments.length-1);for(let r=0;r<arguments.length;r++)e[r]=arguments[r];t(e)}else t(e)})),e.apply(this,o)}))};exports.dist=o,exports.fastSafeStringify=y,exports.pify=(e,r)=>{r=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},r);const t=e=>{const t=r=>"string"==typeof r?e===r:r.test(e);return r.include?r.include.some(t):!r.exclude.some(t)};let o;o="function"==typeof e?function(){return r.excludeMain?e.apply(this,arguments):Q(e,r).apply(this,arguments)}:Object.create(Object.getPrototypeOf(e));for(const n in e){const s=e[n];o[n]="function"==typeof s&&t(n)?Q(s,r):s}return o},exports.safeEventEmitter=f;