@dodoex/wallet-web3 0.0.41 → 0.0.42

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 (78) hide show
  1. package/dist/{DefaultJsonRpcProvider-81dbd3f9.js → DefaultJsonRpcProvider-470545c2.js} +1 -1
  2. package/dist/__node-resolve_empty-f90bb206.js +1 -0
  3. package/dist/__tslib-041a522f.js +1 -0
  4. package/dist/{blocto-a553b391.js → blocto-a613e3ea.js} +1 -1
  5. package/dist/{bn-8f7cc9b5.js → bn-a73d500d.js} +1 -1
  6. package/dist/{browser-ponyfill-4134b2b7.js → browser-ponyfill-5a72503b.js} +1 -1
  7. package/dist/cjs/{DefaultJsonRpcProvider-851de86a.cjs → DefaultJsonRpcProvider-1b124fcf.cjs} +1 -1
  8. package/dist/cjs/{__node-resolve_empty-04cc3662.cjs → __node-resolve_empty-c6c4d691.cjs} +1 -1
  9. package/dist/cjs/__tslib-74b92aa0.cjs +1 -0
  10. package/dist/cjs/{blocto-1d2d3abc.cjs → blocto-54eeaf0e.cjs} +1 -1
  11. package/dist/cjs/{bn-8a65a921.cjs → bn-5799deeb.cjs} +1 -1
  12. package/dist/cjs/{browser-ponyfill-96a14706.cjs → browser-ponyfill-98c87b2b.cjs} +1 -1
  13. package/dist/cjs/{draggabilly-326f0353.cjs → draggabilly-0280fdd9.cjs} +1 -1
  14. package/dist/cjs/{ethers-c6e7830c.cjs → ethers-1f3c68c5.cjs} +1 -1
  15. package/dist/cjs/{id-ac2184da.cjs → id-f0a49000.cjs} +1 -1
  16. package/dist/cjs/{index-4685dfbc.cjs → index-1334a219.cjs} +2 -2
  17. package/dist/cjs/{index-c6a78b5c.cjs → index-26ef8efb.cjs} +1 -1
  18. package/dist/cjs/{index-b3a93c7d.cjs → index-47b72555.cjs} +1 -1
  19. package/dist/cjs/{index-97c32dcf.cjs → index-5d2a4d45.cjs} +1 -1
  20. package/dist/cjs/{index-01b3872e.cjs → index-7c8afb3d.cjs} +1 -1
  21. package/dist/cjs/{index-8d32723e.cjs → index-876f807b.cjs} +1 -1
  22. package/dist/cjs/{index-4f46ab04.cjs → index-965f574d.cjs} +1 -1
  23. package/dist/cjs/{index-6130f88a.cjs → index-9c3d3910.cjs} +2 -2
  24. package/dist/cjs/{index-38a82c12.cjs → index-ade355c8.cjs} +1 -1
  25. package/dist/cjs/{index-d89005f4.cjs → index-dbfff00c.cjs} +1 -1
  26. package/dist/cjs/{index-823d3a25.cjs → index-eeb0556a.cjs} +1 -1
  27. package/dist/cjs/index.cjs +1 -1
  28. package/dist/cjs/{index.es-168fe2b1.cjs → index.es-d8a23b8c.cjs} +1 -1
  29. package/dist/cjs/{interface-f6b53727.cjs → interface-32ec049c.cjs} +1 -1
  30. package/dist/cjs/{lib-typedarrays-05755aa6.cjs → lib-typedarrays-c773181b.cjs} +1 -1
  31. package/dist/cjs/{portis-7873ce6a.cjs → portis-7b794882.cjs} +1 -1
  32. package/dist/cjs/{provider-d7c647ea.cjs → provider-73c10a83.cjs} +1 -1
  33. package/dist/cjs/providers/connector/injected.d.ts +1 -1
  34. package/dist/cjs/providers/connector/types.d.ts +1 -0
  35. package/dist/cjs/{rainbow-43c8e5f6.cjs → rainbow-59104eb0.cjs} +1 -1
  36. package/dist/cjs/sha224-c7a50394.cjs +1 -0
  37. package/dist/cjs/{sha256-7cc68713.cjs → sha256-33ca448e.cjs} +1 -1
  38. package/dist/cjs/{uAuth-6aa71b34.cjs → uAuth-2de77cf5.cjs} +1 -1
  39. package/dist/cjs/walletConnect-23c4ab09.cjs +1 -0
  40. package/dist/cjs/{walletLink-eb56d177.cjs → walletLink-e9532414.cjs} +1 -1
  41. package/dist/{draggabilly-291f869b.js → draggabilly-186183f4.js} +1 -1
  42. package/dist/{ethers-f8f094be.js → ethers-5bf5b00b.js} +1 -1
  43. package/dist/{id-dcb529f4.js → id-f73e9185.js} +1 -1
  44. package/dist/{index-a1df7720.js → index-4a260eae.js} +1 -1
  45. package/dist/{index-e3070128.js → index-4a2d9b19.js} +1 -1
  46. package/dist/{index-20ce8a4c.js → index-66448990.js} +1 -1
  47. package/dist/{index-cebac794.js → index-687aa034.js} +2 -2
  48. package/dist/{index-bc061f7b.js → index-8cc67274.js} +1 -1
  49. package/dist/{index-cec5c507.js → index-9ef93cee.js} +1 -1
  50. package/dist/{index-7a7a090a.js → index-b7b5de53.js} +1 -1
  51. package/dist/{index-89a7e976.js → index-d18b1515.js} +1 -1
  52. package/dist/index-ec768c82.js +1 -0
  53. package/dist/{index-914dc773.js → index-fca1a0c3.js} +1 -1
  54. package/dist/{index-4e6b81d8.js → index-fdf822d6.js} +1 -1
  55. package/dist/{index.es-b6986074.js → index.es-d0dcd244.js} +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/{interface-6c3ec32a.js → interface-cd17b51d.js} +1 -1
  58. package/dist/{lib-typedarrays-f1051e37.js → lib-typedarrays-b049d0e6.js} +1 -1
  59. package/dist/{portis-6c321b6b.js → portis-eedfe5a8.js} +1 -1
  60. package/dist/{provider-0a241f15.js → provider-cc8e4040.js} +1 -1
  61. package/dist/providers/connector/injected.d.ts +1 -1
  62. package/dist/providers/connector/types.d.ts +1 -0
  63. package/dist/rainbow-bc431cfa.js +1 -0
  64. package/dist/sha224-882535a5.js +1 -0
  65. package/dist/{sha256-79cd8cb2.js → sha256-081247ed.js} +1 -1
  66. package/dist/{uAuth-57530103.js → uAuth-acbb6033.js} +1 -1
  67. package/dist/walletConnect-622e5dfc.js +1 -0
  68. package/dist/{walletLink-7f641f02.js → walletLink-90f5ac8d.js} +1 -1
  69. package/package.json +1 -1
  70. package/dist/__node-resolve_empty-314df16e.js +0 -1
  71. package/dist/__tslib-895a7349.js +0 -1
  72. package/dist/cjs/__tslib-07f80053.cjs +0 -1
  73. package/dist/cjs/sha224-86e8cc7f.cjs +0 -1
  74. package/dist/cjs/walletConnect-b0df4f12.cjs +0 -1
  75. package/dist/index-cbfb042c.js +0 -1
  76. package/dist/rainbow-43a583fd.js +0 -1
  77. package/dist/sha224-1e5a1736.js +0 -1
  78. package/dist/walletConnect-dc900305.js +0 -1
@@ -1 +1 @@
1
- "use strict";var t=require("@ethersproject/address"),e=require("@ethersproject/bytes"),r=require("./index-4685dfbc.cjs"),n=require("@ethersproject/properties"),o=require("./id-ac2184da.cjs");const i="hash/5.7.0";function s(t){t=atob(t);const r=[];for(let e=0;e<t.length;e++)r.push(t.charCodeAt(e));return e.arrayify(r)}function a(t){t=e.arrayify(t);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}var c=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const u=new o.Logger(i),l=new Uint8Array(32);l.fill(0);const f=o.BigNumber.from(-1),h=o.BigNumber.from(0),d=o.BigNumber.from(1),y=o.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const p=e.hexZeroPad(d.toHexString(),32),m=e.hexZeroPad(h.toHexString(),32),g={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},v=["name","version","chainId","verifyingContract","salt"];function w(t){return function(e){return"string"!=typeof e&&u.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const E={name:w("name"),version:w("version"),chainId:function(t){try{return o.BigNumber.from(t).toString()}catch(t){}return u.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(e){try{return t.getAddress(e).toLowerCase()}catch(t){}return u.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(t){try{const r=e.arrayify(t);if(32!==r.length)throw new Error("bad length");return e.hexlify(r)}catch(t){}return u.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function b(n){{const t=n.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],i=parseInt(t[2]||"256");(i%8!=0||i>256||t[2]&&t[2]!==String(i))&&u.throwArgumentError("invalid numeric width","type",n);const s=y.mask(r?i-1:i),a=r?s.add(d).mul(f):h;return function(t){const r=o.BigNumber.from(t);return(r.lt(a)||r.gt(s))&&u.throwArgumentError(`value out-of-bounds for ${n}`,"value",t),e.hexZeroPad(r.toTwos(256).toHexString(),32)}}}{const t=n.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&u.throwArgumentError("invalid bytes width","type",n),function(t){return e.arrayify(t).length!==r&&u.throwArgumentError(`invalid length for ${n}`,"value",t),function(t){const r=e.arrayify(t),n=r.length%32;return n?e.hexConcat([r,l.slice(n)]):e.hexlify(r)}(t)}}}switch(n){case"address":return function(r){return e.hexZeroPad(t.getAddress(r),32)};case"bool":return function(t){return t?p:m};case"bytes":return function(t){return r.keccak256(t)};case"string":return function(t){return o.id(t)}}return null}function x(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class C{constructor(t){n.defineReadOnly(this,"types",Object.freeze(n.deepCopy(t))),n.defineReadOnly(this,"_encoderCache",{}),n.defineReadOnly(this,"_types",{});const e={},r={},o={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],o[t]={}}));for(const n in t){const o={};t[n].forEach((i=>{o[i.name]&&u.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(n)}`,"types",t),o[i.name]=!0;const s=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&u.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);b(s)||(r[s]||u.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?u.throwArgumentError("missing primary type","types",t):i.length>1&&u.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),n.defineReadOnly(this,"primaryType",i[0]),function n(i,s){s[i]&&u.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",t),s[i]=!0,Object.keys(e[i]).forEach((t=>{r[t]&&(n(t,s),Object.keys(s).forEach((e=>{o[e][t]=!0})))})),delete s[i]}(this.primaryType,{});for(const e in o){const r=Object.keys(o[e]);r.sort(),this._types[e]=x(e,t[e])+r.map((e=>x(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=b(t);if(e)return e}const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],o=this.getEncoder(t),i=parseInt(n[3]);return n=>{i>=0&&n.length!==i&&u.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",n);let s=n.map(o);return this._types[t]&&(s=s.map(r.keccak256)),r.keccak256(e.hexConcat(s))}}const i=this.types[t];if(i){const n=o.id(this._types[t]);return t=>{const o=i.map((({name:e,type:n})=>{const o=this.getEncoder(n)(t[e]);return this._types[n]?r.keccak256(o):o}));return o.unshift(n),e.hexConcat(o)}}return u.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||u.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return r.keccak256(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(b(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],o=parseInt(n[3]);return o>=0&&e.length!==o&&u.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const o=this.types[t];return o?o.reduce(((t,{name:n,type:o})=>(t[n]=this._visit(o,e[n],r),t)),{}):u.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new C(t)}static getPrimaryType(t){return C.from(t).primaryType}static hashStruct(t,e,r){return C.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=g[r];n||u.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>v.indexOf(t.name)-v.indexOf(e.name))),C.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,r,n){return e.hexConcat(["0x1901",C.hashDomain(t),C.from(r).hash(n)])}static hash(t,e,n){return r.keccak256(C.encode(t,e,n))}static resolveNames(t,r,o,i){return c(this,void 0,void 0,(function*(){t=n.shallowCopy(t);const s={};t.verifyingContract&&!e.isHexString(t.verifyingContract,20)&&(s[t.verifyingContract]="0x");const a=C.from(r);a.visit(o,((t,r)=>("address"!==t||e.isHexString(r,20)||(s[r]="0x"),r)));for(const t in s)s[t]=yield i(t);return t.verifyingContract&&s[t.verifyingContract]&&(t.verifyingContract=s[t.verifyingContract]),o=a.visit(o,((t,e)=>"address"===t&&s[e]?s[e]:e)),{domain:t,value:o}}))}static getPayload(t,r,i){C.hashDomain(t);const s={},a=[];v.forEach((e=>{const r=t[e];null!=r&&(s[e]=E[e](r),a.push({name:e,type:g[e]}))}));const c=C.from(r),l=n.shallowCopy(r);return l.EIP712Domain?u.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):l.EIP712Domain=a,c.encode(i),{types:l,domain:s,primaryType:c.primaryType,message:c.visit(i,((t,r)=>{if(t.match(/^bytes(\d*)/))return e.hexlify(e.arrayify(r));if(t.match(/^u?int/))return o.BigNumber.from(r).toString();switch(t){case"address":return r.toLowerCase();case"bool":return!!r;case"string":return"string"!=typeof r&&u.throwArgumentError("invalid string","value",r),r}return u.throwArgumentError("unsupported type","type",t)}))}}}var S=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};function k(t,r){return S(this,void 0,void 0,(function*(){null==r&&(r={});const n={method:r.method||"GET",headers:r.headers||{},body:r.body||void 0};if(!0!==r.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=r.fetchOptions){const t=r.fetchOptions;t.mode&&(n.mode=t.mode),t.cache&&(n.cache=t.cache),t.credentials&&(n.credentials=t.credentials),t.redirect&&(n.redirect=t.redirect),t.referrer&&(n.referrer=t.referrer)}const o=yield fetch(t,n),i=yield o.arrayBuffer(),s={};return o.headers.forEach?o.headers.forEach(((t,e)=>{s[e.toLowerCase()]=t})):o.headers.keys().forEach((t=>{s[t.toLowerCase()]=o.headers.get(t)})),{headers:s,statusCode:o.status,statusMessage:o.statusText,body:e.arrayify(new Uint8Array(i))}}))}var O=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const R=new o.Logger("web/5.7.1");function A(t){return new Promise((e=>{setTimeout(e,t)}))}function T(t,r){if(null==t)return null;if("string"==typeof t)return t;if(e.isBytesLike(t)){if(r&&("text"===r.split("/")[0]||"application/json"===r.split(";")[0].trim()))try{return o.toUtf8String(t)}catch(t){}return e.hexlify(t)}return t}function _(t,e,r){const i="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;R.assertArgument(i>0&&i%1==0,"invalid connection throttle limit","connection.throttleLimit",i);const c="object"==typeof t?t.throttleCallback:null,u="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;R.assertArgument(u>0&&u%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",u);const l="object"==typeof t&&!!t.errorPassThrough,f={};let h=null;const d={method:"GET"};let y=!1,p=12e4;if("string"==typeof t)h=t;else if("object"==typeof t){if(null!=t&&null!=t.url||R.throwArgumentError("missing URL","connection.url",t),h=t.url,"number"==typeof t.timeout&&t.timeout>0&&(p=t.timeout),t.headers)for(const e in t.headers)f[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(y=!0);if(d.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==h.substring(0,6)&&!0!==t.allowInsecureAuthentication&&R.throwError("basic authentication requires a secure https url",o.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:h,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;f.authorization={key:"Authorization",value:"Basic "+a(o.toUtf8Bytes(e))}}null!=t.skipFetchSetup&&(d.skipFetchSetup=!!t.skipFetchSetup),null!=t.fetchOptions&&(d.fetchOptions=n.shallowCopy(t.fetchOptions))}const m=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),g=h?h.match(m):null;if(g)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":g[1]||"text/plain"},body:g[2]?s(g[3]):(v=g[3],o.toUtf8Bytes(v.replace(/%([0-9a-f][0-9a-f])/gi,((t,e)=>String.fromCharCode(parseInt(e,16))))))};let e=t.body;return r&&(e=r(t.body,t)),Promise.resolve(e)}catch(t){R.throwError("processing response error",o.Logger.errors.SERVER_ERROR,{body:T(g[1],g[2]),error:t,requestBody:null,requestMethod:"GET",url:h})}var v;e&&(d.method="POST",d.body=e,null==f["content-type"]&&(f["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==f["content-length"]&&(f["content-length"]={key:"Content-Length",value:String(e.length)}));const w={};Object.keys(f).forEach((t=>{const e=f[t];w[e.key]=e.value})),d.headers=w;const E=function(){let t=null;return{promise:new Promise((function(e,r){p&&(t=setTimeout((()=>{null!=t&&(t=null,r(R.makeError("timeout",o.Logger.errors.TIMEOUT,{requestBody:T(d.body,w["content-type"]),requestMethod:d.method,timeout:p,url:h})))}),p))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),b=function(){return O(this,void 0,void 0,(function*(){for(let t=0;t<i;t++){let e=null;try{if(e=yield k(h,d),t<i)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===d.method&&t.match(/^https:/)){h=e.headers.location;continue}}else if(429===e.statusCode){let r=!0;if(c&&(r=yield c(t,h)),r){let r=0;const n=e.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):u*parseInt(String(Math.random()*Math.pow(2,t))),yield A(r);continue}}}catch(t){e=t.response,null==e&&(E.cancel(),R.throwError("missing response",o.Logger.errors.SERVER_ERROR,{requestBody:T(d.body,w["content-type"]),requestMethod:d.method,serverError:t,url:h}))}let n=e.body;if(y&&304===e.statusCode?n=null:!l&&(e.statusCode<200||e.statusCode>=300)&&(E.cancel(),R.throwError("bad response",o.Logger.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:T(n,e.headers?e.headers["content-type"]:null),requestBody:T(d.body,w["content-type"]),requestMethod:d.method,url:h})),r)try{const t=yield r(n,e);return E.cancel(),t}catch(r){if(r.throttleRetry&&t<i){let e=!0;if(c&&(e=yield c(t,h)),e){const e=u*parseInt(String(Math.random()*Math.pow(2,t)));yield A(e);continue}}E.cancel(),R.throwError("processing response error",o.Logger.errors.SERVER_ERROR,{body:T(n,e.headers?e.headers["content-type"]:null),error:r,requestBody:T(d.body,w["content-type"]),requestMethod:d.method,url:h})}return E.cancel(),n}return R.throwError("failed response",o.Logger.errors.SERVER_ERROR,{requestBody:T(d.body,w["content-type"]),requestMethod:d.method,url:h})}))}();return Promise.race([E.promise,b])}function I(t,e,r){let i=null;if(null!=e){i=o.toUtf8Bytes(e);const r="string"==typeof t?{url:t}:n.shallowCopy(t);if(r.headers){0!==Object.keys(r.headers).filter((t=>"content-type"===t.toLowerCase())).length||(r.headers=n.shallowCopy(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};t=r}return _(t,i,((t,e)=>{let n=null;if(null!=t)try{n=JSON.parse(o.toUtf8String(t))}catch(e){R.throwError("invalid JSON",o.Logger.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function L(t,e){return e||(e={}),null==(e=n.shallowCopy(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){let o=null,i=!1;const s=()=>!i&&(i=!0,o&&clearTimeout(o),!0);e.timeout&&(o=setTimeout((()=>{s()&&n(new Error("timeout"))}),e.timeout));const a=e.retryLimit;let c=0;!function o(){return t().then((function(t){if(void 0!==t)s()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",o);else if(e.onceBlock)e.onceBlock.once("block",o);else if(!i){if(c++,c>a)return void(s()&&n(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));t<e.floor&&(t=e.floor),t>e.ceiling&&(t=e.ceiling),setTimeout(o,t)}return null}),(function(t){s()&&n(t)}))}()}))}var j=Object.freeze({__proto__:null,_fetchData:_,fetchJson:I,poll:L});exports.TypedDataEncoder=C,exports._fetchData=_,exports.decode=s,exports.encode=a,exports.fetchJson=I,exports.lib_esm=j,exports.poll=L,exports.version=i;
1
+ "use strict";var t=require("@ethersproject/address"),e=require("@ethersproject/bytes"),r=require("./index-1334a219.cjs"),n=require("@ethersproject/properties"),o=require("./id-f0a49000.cjs");const i="hash/5.7.0";function s(t){t=atob(t);const r=[];for(let e=0;e<t.length;e++)r.push(t.charCodeAt(e));return e.arrayify(r)}function a(t){t=e.arrayify(t);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}var c=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const u=new o.Logger(i),l=new Uint8Array(32);l.fill(0);const f=o.BigNumber.from(-1),h=o.BigNumber.from(0),d=o.BigNumber.from(1),y=o.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const p=e.hexZeroPad(d.toHexString(),32),m=e.hexZeroPad(h.toHexString(),32),g={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},v=["name","version","chainId","verifyingContract","salt"];function w(t){return function(e){return"string"!=typeof e&&u.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const E={name:w("name"),version:w("version"),chainId:function(t){try{return o.BigNumber.from(t).toString()}catch(t){}return u.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(e){try{return t.getAddress(e).toLowerCase()}catch(t){}return u.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(t){try{const r=e.arrayify(t);if(32!==r.length)throw new Error("bad length");return e.hexlify(r)}catch(t){}return u.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function b(n){{const t=n.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],i=parseInt(t[2]||"256");(i%8!=0||i>256||t[2]&&t[2]!==String(i))&&u.throwArgumentError("invalid numeric width","type",n);const s=y.mask(r?i-1:i),a=r?s.add(d).mul(f):h;return function(t){const r=o.BigNumber.from(t);return(r.lt(a)||r.gt(s))&&u.throwArgumentError(`value out-of-bounds for ${n}`,"value",t),e.hexZeroPad(r.toTwos(256).toHexString(),32)}}}{const t=n.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&u.throwArgumentError("invalid bytes width","type",n),function(t){return e.arrayify(t).length!==r&&u.throwArgumentError(`invalid length for ${n}`,"value",t),function(t){const r=e.arrayify(t),n=r.length%32;return n?e.hexConcat([r,l.slice(n)]):e.hexlify(r)}(t)}}}switch(n){case"address":return function(r){return e.hexZeroPad(t.getAddress(r),32)};case"bool":return function(t){return t?p:m};case"bytes":return function(t){return r.keccak256(t)};case"string":return function(t){return o.id(t)}}return null}function x(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class C{constructor(t){n.defineReadOnly(this,"types",Object.freeze(n.deepCopy(t))),n.defineReadOnly(this,"_encoderCache",{}),n.defineReadOnly(this,"_types",{});const e={},r={},o={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],o[t]={}}));for(const n in t){const o={};t[n].forEach((i=>{o[i.name]&&u.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(n)}`,"types",t),o[i.name]=!0;const s=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&u.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);b(s)||(r[s]||u.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?u.throwArgumentError("missing primary type","types",t):i.length>1&&u.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),n.defineReadOnly(this,"primaryType",i[0]),function n(i,s){s[i]&&u.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",t),s[i]=!0,Object.keys(e[i]).forEach((t=>{r[t]&&(n(t,s),Object.keys(s).forEach((e=>{o[e][t]=!0})))})),delete s[i]}(this.primaryType,{});for(const e in o){const r=Object.keys(o[e]);r.sort(),this._types[e]=x(e,t[e])+r.map((e=>x(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=b(t);if(e)return e}const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],o=this.getEncoder(t),i=parseInt(n[3]);return n=>{i>=0&&n.length!==i&&u.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",n);let s=n.map(o);return this._types[t]&&(s=s.map(r.keccak256)),r.keccak256(e.hexConcat(s))}}const i=this.types[t];if(i){const n=o.id(this._types[t]);return t=>{const o=i.map((({name:e,type:n})=>{const o=this.getEncoder(n)(t[e]);return this._types[n]?r.keccak256(o):o}));return o.unshift(n),e.hexConcat(o)}}return u.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||u.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return r.keccak256(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(b(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],o=parseInt(n[3]);return o>=0&&e.length!==o&&u.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const o=this.types[t];return o?o.reduce(((t,{name:n,type:o})=>(t[n]=this._visit(o,e[n],r),t)),{}):u.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new C(t)}static getPrimaryType(t){return C.from(t).primaryType}static hashStruct(t,e,r){return C.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=g[r];n||u.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>v.indexOf(t.name)-v.indexOf(e.name))),C.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,r,n){return e.hexConcat(["0x1901",C.hashDomain(t),C.from(r).hash(n)])}static hash(t,e,n){return r.keccak256(C.encode(t,e,n))}static resolveNames(t,r,o,i){return c(this,void 0,void 0,(function*(){t=n.shallowCopy(t);const s={};t.verifyingContract&&!e.isHexString(t.verifyingContract,20)&&(s[t.verifyingContract]="0x");const a=C.from(r);a.visit(o,((t,r)=>("address"!==t||e.isHexString(r,20)||(s[r]="0x"),r)));for(const t in s)s[t]=yield i(t);return t.verifyingContract&&s[t.verifyingContract]&&(t.verifyingContract=s[t.verifyingContract]),o=a.visit(o,((t,e)=>"address"===t&&s[e]?s[e]:e)),{domain:t,value:o}}))}static getPayload(t,r,i){C.hashDomain(t);const s={},a=[];v.forEach((e=>{const r=t[e];null!=r&&(s[e]=E[e](r),a.push({name:e,type:g[e]}))}));const c=C.from(r),l=n.shallowCopy(r);return l.EIP712Domain?u.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):l.EIP712Domain=a,c.encode(i),{types:l,domain:s,primaryType:c.primaryType,message:c.visit(i,((t,r)=>{if(t.match(/^bytes(\d*)/))return e.hexlify(e.arrayify(r));if(t.match(/^u?int/))return o.BigNumber.from(r).toString();switch(t){case"address":return r.toLowerCase();case"bool":return!!r;case"string":return"string"!=typeof r&&u.throwArgumentError("invalid string","value",r),r}return u.throwArgumentError("unsupported type","type",t)}))}}}var S=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};function k(t,r){return S(this,void 0,void 0,(function*(){null==r&&(r={});const n={method:r.method||"GET",headers:r.headers||{},body:r.body||void 0};if(!0!==r.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=r.fetchOptions){const t=r.fetchOptions;t.mode&&(n.mode=t.mode),t.cache&&(n.cache=t.cache),t.credentials&&(n.credentials=t.credentials),t.redirect&&(n.redirect=t.redirect),t.referrer&&(n.referrer=t.referrer)}const o=yield fetch(t,n),i=yield o.arrayBuffer(),s={};return o.headers.forEach?o.headers.forEach(((t,e)=>{s[e.toLowerCase()]=t})):o.headers.keys().forEach((t=>{s[t.toLowerCase()]=o.headers.get(t)})),{headers:s,statusCode:o.status,statusMessage:o.statusText,body:e.arrayify(new Uint8Array(i))}}))}var O=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const R=new o.Logger("web/5.7.1");function A(t){return new Promise((e=>{setTimeout(e,t)}))}function T(t,r){if(null==t)return null;if("string"==typeof t)return t;if(e.isBytesLike(t)){if(r&&("text"===r.split("/")[0]||"application/json"===r.split(";")[0].trim()))try{return o.toUtf8String(t)}catch(t){}return e.hexlify(t)}return t}function _(t,e,r){const i="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;R.assertArgument(i>0&&i%1==0,"invalid connection throttle limit","connection.throttleLimit",i);const c="object"==typeof t?t.throttleCallback:null,u="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;R.assertArgument(u>0&&u%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",u);const l="object"==typeof t&&!!t.errorPassThrough,f={};let h=null;const d={method:"GET"};let y=!1,p=12e4;if("string"==typeof t)h=t;else if("object"==typeof t){if(null!=t&&null!=t.url||R.throwArgumentError("missing URL","connection.url",t),h=t.url,"number"==typeof t.timeout&&t.timeout>0&&(p=t.timeout),t.headers)for(const e in t.headers)f[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(y=!0);if(d.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==h.substring(0,6)&&!0!==t.allowInsecureAuthentication&&R.throwError("basic authentication requires a secure https url",o.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:h,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;f.authorization={key:"Authorization",value:"Basic "+a(o.toUtf8Bytes(e))}}null!=t.skipFetchSetup&&(d.skipFetchSetup=!!t.skipFetchSetup),null!=t.fetchOptions&&(d.fetchOptions=n.shallowCopy(t.fetchOptions))}const m=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),g=h?h.match(m):null;if(g)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":g[1]||"text/plain"},body:g[2]?s(g[3]):(v=g[3],o.toUtf8Bytes(v.replace(/%([0-9a-f][0-9a-f])/gi,((t,e)=>String.fromCharCode(parseInt(e,16))))))};let e=t.body;return r&&(e=r(t.body,t)),Promise.resolve(e)}catch(t){R.throwError("processing response error",o.Logger.errors.SERVER_ERROR,{body:T(g[1],g[2]),error:t,requestBody:null,requestMethod:"GET",url:h})}var v;e&&(d.method="POST",d.body=e,null==f["content-type"]&&(f["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==f["content-length"]&&(f["content-length"]={key:"Content-Length",value:String(e.length)}));const w={};Object.keys(f).forEach((t=>{const e=f[t];w[e.key]=e.value})),d.headers=w;const E=function(){let t=null;return{promise:new Promise((function(e,r){p&&(t=setTimeout((()=>{null!=t&&(t=null,r(R.makeError("timeout",o.Logger.errors.TIMEOUT,{requestBody:T(d.body,w["content-type"]),requestMethod:d.method,timeout:p,url:h})))}),p))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),b=function(){return O(this,void 0,void 0,(function*(){for(let t=0;t<i;t++){let e=null;try{if(e=yield k(h,d),t<i)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===d.method&&t.match(/^https:/)){h=e.headers.location;continue}}else if(429===e.statusCode){let r=!0;if(c&&(r=yield c(t,h)),r){let r=0;const n=e.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):u*parseInt(String(Math.random()*Math.pow(2,t))),yield A(r);continue}}}catch(t){e=t.response,null==e&&(E.cancel(),R.throwError("missing response",o.Logger.errors.SERVER_ERROR,{requestBody:T(d.body,w["content-type"]),requestMethod:d.method,serverError:t,url:h}))}let n=e.body;if(y&&304===e.statusCode?n=null:!l&&(e.statusCode<200||e.statusCode>=300)&&(E.cancel(),R.throwError("bad response",o.Logger.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:T(n,e.headers?e.headers["content-type"]:null),requestBody:T(d.body,w["content-type"]),requestMethod:d.method,url:h})),r)try{const t=yield r(n,e);return E.cancel(),t}catch(r){if(r.throttleRetry&&t<i){let e=!0;if(c&&(e=yield c(t,h)),e){const e=u*parseInt(String(Math.random()*Math.pow(2,t)));yield A(e);continue}}E.cancel(),R.throwError("processing response error",o.Logger.errors.SERVER_ERROR,{body:T(n,e.headers?e.headers["content-type"]:null),error:r,requestBody:T(d.body,w["content-type"]),requestMethod:d.method,url:h})}return E.cancel(),n}return R.throwError("failed response",o.Logger.errors.SERVER_ERROR,{requestBody:T(d.body,w["content-type"]),requestMethod:d.method,url:h})}))}();return Promise.race([E.promise,b])}function I(t,e,r){let i=null;if(null!=e){i=o.toUtf8Bytes(e);const r="string"==typeof t?{url:t}:n.shallowCopy(t);if(r.headers){0!==Object.keys(r.headers).filter((t=>"content-type"===t.toLowerCase())).length||(r.headers=n.shallowCopy(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};t=r}return _(t,i,((t,e)=>{let n=null;if(null!=t)try{n=JSON.parse(o.toUtf8String(t))}catch(e){R.throwError("invalid JSON",o.Logger.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function L(t,e){return e||(e={}),null==(e=n.shallowCopy(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){let o=null,i=!1;const s=()=>!i&&(i=!0,o&&clearTimeout(o),!0);e.timeout&&(o=setTimeout((()=>{s()&&n(new Error("timeout"))}),e.timeout));const a=e.retryLimit;let c=0;!function o(){return t().then((function(t){if(void 0!==t)s()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",o);else if(e.onceBlock)e.onceBlock.once("block",o);else if(!i){if(c++,c>a)return void(s()&&n(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));t<e.floor&&(t=e.floor),t>e.ceiling&&(t=e.ceiling),setTimeout(o,t)}return null}),(function(t){s()&&n(t)}))}()}))}var j=Object.freeze({__proto__:null,_fetchData:_,fetchJson:I,poll:L});exports.TypedDataEncoder=C,exports._fetchData=_,exports.decode=s,exports.encode=a,exports.fetchJson=I,exports.lib_esm=j,exports.poll=L,exports.version=i;