@dodoex/wallet-web3 0.0.41-4 → 0.0.41-6

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 (75) hide show
  1. package/dist/{DefaultJsonRpcProvider-6a21f359.js → DefaultJsonRpcProvider-39051876.js} +1 -1
  2. package/dist/__node-resolve_empty-8d36ef45.js +1 -0
  3. package/dist/__tslib-028c435c.js +1 -0
  4. package/dist/{blocto-1e01ed61.js → blocto-b1fd16e0.js} +1 -1
  5. package/dist/{bn-43db0a80.js → bn-6691dc4b.js} +1 -1
  6. package/dist/{browser-ponyfill-dbcd3487.js → browser-ponyfill-45febd35.js} +1 -1
  7. package/dist/cjs/{DefaultJsonRpcProvider-2896bdc6.cjs → DefaultJsonRpcProvider-9c49bc74.cjs} +1 -1
  8. package/dist/cjs/{__node-resolve_empty-1e1ab047.cjs → __node-resolve_empty-cc04456f.cjs} +1 -1
  9. package/dist/cjs/__tslib-1a913bb4.cjs +1 -0
  10. package/dist/cjs/{blocto-66f8432e.cjs → blocto-21bcf508.cjs} +1 -1
  11. package/dist/cjs/{bn-6c93fb4c.cjs → bn-f78d1a17.cjs} +1 -1
  12. package/dist/cjs/{browser-ponyfill-5cbcbec7.cjs → browser-ponyfill-1a8d200e.cjs} +1 -1
  13. package/dist/cjs/{draggabilly-f0c0e597.cjs → draggabilly-f1bb3b36.cjs} +1 -1
  14. package/dist/cjs/{ethers-5799ca27.cjs → ethers-b4443d90.cjs} +1 -1
  15. package/dist/cjs/{id-48662e0b.cjs → id-81d6569b.cjs} +1 -1
  16. package/dist/cjs/{index-7a5facb5.cjs → index-1cf2025a.cjs} +1 -1
  17. package/dist/cjs/index-2b6e2d0e.cjs +9 -0
  18. package/dist/cjs/{index-9898e190.cjs → index-2faa3982.cjs} +1 -1
  19. package/dist/cjs/{index-9bc0d4c3.cjs → index-39d0684d.cjs} +1 -1
  20. package/dist/cjs/{index-d36fba96.cjs → index-50ef639c.cjs} +1 -1
  21. package/dist/cjs/{index-6c6c6323.cjs → index-603ccd56.cjs} +1 -1
  22. package/dist/cjs/{index-48d95e72.cjs → index-61c5fbfc.cjs} +1 -1
  23. package/dist/cjs/{index-0dd9ae9a.cjs → index-7fb18b59.cjs} +1 -1
  24. package/dist/cjs/{index-0984de48.cjs → index-81e04477.cjs} +1 -1
  25. package/dist/cjs/{index-84bddb78.cjs → index-bb9d8efd.cjs} +2 -2
  26. package/dist/cjs/index-fec2b0e7.cjs +1 -0
  27. package/dist/cjs/index.cjs +1 -1
  28. package/dist/cjs/{index.es-d276a0c3.cjs → index.es-c188e54b.cjs} +1 -1
  29. package/dist/cjs/{interface-27dc9126.cjs → interface-847c070f.cjs} +1 -1
  30. package/dist/cjs/{lib-typedarrays-bf82ea24.cjs → lib-typedarrays-924fdb15.cjs} +1 -1
  31. package/dist/cjs/{portis-282159f7.cjs → portis-04649135.cjs} +1 -1
  32. package/dist/cjs/{provider-e4b2bc55.cjs → provider-55f49a37.cjs} +1 -1
  33. package/dist/cjs/{rainbow-77aec431.cjs → rainbow-331b4b7f.cjs} +1 -1
  34. package/dist/cjs/{sha224-770ad141.cjs → sha224-ec932277.cjs} +1 -1
  35. package/dist/cjs/{sha256-8765e543.cjs → sha256-a9306fd5.cjs} +1 -1
  36. package/dist/cjs/state.d.ts +1 -0
  37. package/dist/cjs/{uAuth-66e7f842.cjs → uAuth-f08a6bc1.cjs} +1 -1
  38. package/dist/cjs/{walletConnect-67671d50.cjs → walletConnect-4a8a9594.cjs} +1 -1
  39. package/dist/cjs/{walletLink-75d77597.cjs → walletLink-55148573.cjs} +1 -1
  40. package/dist/{draggabilly-542c5cae.js → draggabilly-bfad3669.js} +1 -1
  41. package/dist/{ethers-fe9fa84f.js → ethers-149a03bf.js} +1 -1
  42. package/dist/{id-693d7c84.js → id-9ebc6c25.js} +1 -1
  43. package/dist/{index-1bf00f8f.js → index-1fbb15b5.js} +2 -2
  44. package/dist/{index-3c3d04d7.js → index-2421fbca.js} +1 -1
  45. package/dist/{index-d5b21786.js → index-33d9ef5d.js} +1 -1
  46. package/dist/{index-1f918a4b.js → index-3fa89254.js} +1 -1
  47. package/dist/index-5bdb764f.js +9 -0
  48. package/dist/{index-ff04a168.js → index-660d9f03.js} +1 -1
  49. package/dist/{index-3bb899bf.js → index-b40bcea4.js} +1 -1
  50. package/dist/{index-e1a91fd3.js → index-bf8de361.js} +2 -2
  51. package/dist/{index-79f8a14f.js → index-c900ddbc.js} +1 -1
  52. package/dist/index-c953d0ac.js +1 -0
  53. package/dist/{index-f728f8ed.js → index-e4bf19f4.js} +1 -1
  54. package/dist/{index.es-c9a2db2c.js → index.es-5eecb376.js} +1 -1
  55. package/dist/index.js +1 -1
  56. package/dist/{interface-936da3ce.js → interface-b85b700d.js} +1 -1
  57. package/dist/{lib-typedarrays-38faff47.js → lib-typedarrays-a8e83421.js} +1 -1
  58. package/dist/{portis-76a8e487.js → portis-43f60af4.js} +1 -1
  59. package/dist/{provider-db6426ff.js → provider-301ac332.js} +1 -1
  60. package/dist/rainbow-23c1faed.js +1 -0
  61. package/dist/{sha224-2ced289a.js → sha224-c866b8af.js} +1 -1
  62. package/dist/{sha256-c1265a22.js → sha256-aa67d92b.js} +1 -1
  63. package/dist/state.d.ts +1 -0
  64. package/dist/{uAuth-b6bee9b3.js → uAuth-0c0662eb.js} +1 -1
  65. package/dist/{walletConnect-0903c9e0.js → walletConnect-6fa1fc97.js} +1 -1
  66. package/dist/{walletLink-a9316447.js → walletLink-88727a96.js} +1 -1
  67. package/package.json +1 -1
  68. package/dist/__node-resolve_empty-cca64a4a.js +0 -1
  69. package/dist/__tslib-b24ce2ae.js +0 -1
  70. package/dist/cjs/__tslib-e13a96b6.cjs +0 -1
  71. package/dist/cjs/index-529b9846.cjs +0 -1
  72. package/dist/cjs/index-fd18f5c9.cjs +0 -9
  73. package/dist/index-1137a917.js +0 -1
  74. package/dist/index-51ac6957.js +0 -9
  75. package/dist/rainbow-9a1e9915.js +0 -1
@@ -1 +1 @@
1
- import{getAddress as t}from"@ethersproject/address";import{arrayify as e,hexZeroPad as r,hexConcat as n,isHexString as o,hexlify as i,isBytesLike as s}from"@ethersproject/bytes";import{k as a}from"./index-51ac6957.js";import{defineReadOnly as c,deepCopy as u,shallowCopy as l}from"@ethersproject/properties";import{L as f,B as h,i as d,t as y,a as m}from"./id-693d7c84.js";const p="hash/5.7.0";function g(t){t=atob(t);const r=[];for(let e=0;e<t.length;e++)r.push(t.charCodeAt(e));return e(r)}function v(t){t=e(t);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}var E=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 w=new f(p),b=new Uint8Array(32);b.fill(0);const S=h.from(-1),C=h.from(0),O=h.from(1),R=h.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const A=r(O.toHexString(),32),x=r(C.toHexString(),32),T={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},k=["name","version","chainId","verifyingContract","salt"];function _(t){return function(e){return"string"!=typeof e&&w.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const I={name:_("name"),version:_("version"),chainId:function(t){try{return h.from(t).toString()}catch(t){}return w.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(e){try{return t(e).toLowerCase()}catch(t){}return w.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(t){try{const r=e(t);if(32!==r.length)throw new Error("bad length");return i(r)}catch(t){}return w.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function j(o){{const t=o.match(/^(u?)int(\d*)$/);if(t){const e=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&w.throwArgumentError("invalid numeric width","type",o);const i=R.mask(e?n-1:n),s=e?i.add(O).mul(S):C;return function(t){const e=h.from(t);return(e.lt(s)||e.gt(i))&&w.throwArgumentError(`value out-of-bounds for ${o}`,"value",t),r(e.toTwos(256).toHexString(),32)}}}{const t=o.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&w.throwArgumentError("invalid bytes width","type",o),function(t){return e(t).length!==r&&w.throwArgumentError(`invalid length for ${o}`,"value",t),function(t){const r=e(t),o=r.length%32;return o?n([r,b.slice(o)]):i(r)}(t)}}}switch(o){case"address":return function(e){return r(t(e),32)};case"bool":return function(t){return t?A:x};case"bytes":return function(t){return a(t)};case"string":return function(t){return d(t)}}return null}function $(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class P{constructor(t){c(this,"types",Object.freeze(u(t))),c(this,"_encoderCache",{}),c(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const o={};t[n].forEach((i=>{o[i.name]&&w.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&&w.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);j(s)||(r[s]||w.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const o=Object.keys(r).filter((t=>0===r[t].length));0===o.length?w.throwArgumentError("missing primary type","types",t):o.length>1&&w.throwArgumentError(`ambiguous primary types or unused types: ${o.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),c(this,"primaryType",o[0]),function o(i,s){s[i]&&w.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",t),s[i]=!0,Object.keys(e[i]).forEach((t=>{r[t]&&(o(t,s),Object.keys(s).forEach((e=>{n[e][t]=!0})))})),delete s[i]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=$(e,t[e])+r.map((e=>$(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=j(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),o=parseInt(e[3]);return e=>{o>=0&&e.length!==o&&w.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(a)),a(n(i))}}const r=this.types[t];if(r){const e=d(this._types[t]);return t=>{const o=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?a(n):n}));return o.unshift(e),n(o)}}return w.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||w.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return a(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(j(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&&w.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)),{}):w.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new P(t)}static getPrimaryType(t){return P.from(t).primaryType}static hashStruct(t,e,r){return P.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=T[r];n||w.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>k.indexOf(t.name)-k.indexOf(e.name))),P.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return n(["0x1901",P.hashDomain(t),P.from(e).hash(r)])}static hash(t,e,r){return a(P.encode(t,e,r))}static resolveNames(t,e,r,n){return E(this,void 0,void 0,(function*(){t=l(t);const i={};t.verifyingContract&&!o(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const s=P.from(e);s.visit(r,((t,e)=>("address"!==t||o(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield n(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=s.visit(r,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:r}}))}static getPayload(t,r,n){P.hashDomain(t);const o={},s=[];k.forEach((e=>{const r=t[e];null!=r&&(o[e]=I[e](r),s.push({name:e,type:T[e]}))}));const a=P.from(r),c=l(r);return c.EIP712Domain?w.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):c.EIP712Domain=s,a.encode(n),{types:c,domain:o,primaryType:a.primaryType,message:a.visit(n,((t,r)=>{if(t.match(/^bytes(\d*)/))return i(e(r));if(t.match(/^u?int/))return h.from(r).toString();switch(t){case"address":return r.toLowerCase();case"bool":return!!r;case"string":return"string"!=typeof r&&w.throwArgumentError("invalid string","value",r),r}return w.throwArgumentError("unsupported type","type",t)}))}}}var L=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 D(t,r){return L(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(new Uint8Array(i))}}))}var M=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 N=new f("web/5.7.1");function q(t){return new Promise((e=>{setTimeout(e,t)}))}function J(t,e){if(null==t)return null;if("string"==typeof t)return t;if(s(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return m(t)}catch(t){}return i(t)}return t}function B(t,e,r){const n="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;N.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const o="object"==typeof t?t.throttleCallback:null,i="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;N.assertArgument(i>0&&i%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",i);const s="object"==typeof t&&!!t.errorPassThrough,a={};let c=null;const u={method:"GET"};let h=!1,d=12e4;if("string"==typeof t)c=t;else if("object"==typeof t){if(null!=t&&null!=t.url||N.throwArgumentError("missing URL","connection.url",t),c=t.url,"number"==typeof t.timeout&&t.timeout>0&&(d=t.timeout),t.headers)for(const e in t.headers)a[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(h=!0);if(u.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==c.substring(0,6)&&!0!==t.allowInsecureAuthentication&&N.throwError("basic authentication requires a secure https url",f.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+v(y(e))}}null!=t.skipFetchSetup&&(u.skipFetchSetup=!!t.skipFetchSetup),null!=t.fetchOptions&&(u.fetchOptions=l(t.fetchOptions))}const m=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),p=c?c.match(m):null;if(p)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":p[1]||"text/plain"},body:p[2]?g(p[3]):(E=p[3],y(E.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){N.throwError("processing response error",f.errors.SERVER_ERROR,{body:J(p[1],p[2]),error:t,requestBody:null,requestMethod:"GET",url:c})}var E;e&&(u.method="POST",u.body=e,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const w={};Object.keys(a).forEach((t=>{const e=a[t];w[e.key]=e.value})),u.headers=w;const b=function(){let t=null;return{promise:new Promise((function(e,r){d&&(t=setTimeout((()=>{null!=t&&(t=null,r(N.makeError("timeout",f.errors.TIMEOUT,{requestBody:J(u.body,w["content-type"]),requestMethod:u.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),S=function(){return M(this,void 0,void 0,(function*(){for(let t=0;t<n;t++){let e=null;try{if(e=yield D(c,u),t<n)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===u.method&&t.match(/^https:/)){c=e.headers.location;continue}}else if(429===e.statusCode){let r=!0;if(o&&(r=yield o(t,c)),r){let r=0;const n=e.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):i*parseInt(String(Math.random()*Math.pow(2,t))),yield q(r);continue}}}catch(t){e=t.response,null==e&&(b.cancel(),N.throwError("missing response",f.errors.SERVER_ERROR,{requestBody:J(u.body,w["content-type"]),requestMethod:u.method,serverError:t,url:c}))}let a=e.body;if(h&&304===e.statusCode?a=null:!s&&(e.statusCode<200||e.statusCode>=300)&&(b.cancel(),N.throwError("bad response",f.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:J(a,e.headers?e.headers["content-type"]:null),requestBody:J(u.body,w["content-type"]),requestMethod:u.method,url:c})),r)try{const t=yield r(a,e);return b.cancel(),t}catch(r){if(r.throttleRetry&&t<n){let e=!0;if(o&&(e=yield o(t,c)),e){const e=i*parseInt(String(Math.random()*Math.pow(2,t)));yield q(e);continue}}b.cancel(),N.throwError("processing response error",f.errors.SERVER_ERROR,{body:J(a,e.headers?e.headers["content-type"]:null),error:r,requestBody:J(u.body,w["content-type"]),requestMethod:u.method,url:c})}return b.cancel(),a}return N.throwError("failed response",f.errors.SERVER_ERROR,{requestBody:J(u.body,w["content-type"]),requestMethod:u.method,url:c})}))}();return Promise.race([b.promise,S])}function G(t,e,r){let n=null;if(null!=e){n=y(e);const r="string"==typeof t?{url:t}:l(t);if(r.headers){0!==Object.keys(r.headers).filter((t=>"content-type"===t.toLowerCase())).length||(r.headers=l(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};t=r}return B(t,n,((t,e)=>{let n=null;if(null!=t)try{n=JSON.parse(m(t))}catch(e){N.throwError("invalid JSON",f.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function V(t,e){return e||(e={}),null==(e=l(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 z=Object.freeze({__proto__:null,_fetchData:B,fetchJson:G,poll:V});export{P as T,B as _,g as d,v as e,G as f,z as l,V as p,p as v};
1
+ import{getAddress as t}from"@ethersproject/address";import{arrayify as e,hexZeroPad as r,hexConcat as n,isHexString as o,hexlify as i,isBytesLike as s}from"@ethersproject/bytes";import{k as a}from"./index-5bdb764f.js";import{defineReadOnly as c,deepCopy as u,shallowCopy as l}from"@ethersproject/properties";import{L as f,B as h,i as d,t as y,a as m}from"./id-9ebc6c25.js";const p="hash/5.7.0";function g(t){t=atob(t);const r=[];for(let e=0;e<t.length;e++)r.push(t.charCodeAt(e));return e(r)}function v(t){t=e(t);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}var E=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 w=new f(p),b=new Uint8Array(32);b.fill(0);const S=h.from(-1),C=h.from(0),O=h.from(1),R=h.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const A=r(O.toHexString(),32),x=r(C.toHexString(),32),T={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},k=["name","version","chainId","verifyingContract","salt"];function _(t){return function(e){return"string"!=typeof e&&w.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const I={name:_("name"),version:_("version"),chainId:function(t){try{return h.from(t).toString()}catch(t){}return w.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(e){try{return t(e).toLowerCase()}catch(t){}return w.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(t){try{const r=e(t);if(32!==r.length)throw new Error("bad length");return i(r)}catch(t){}return w.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function j(o){{const t=o.match(/^(u?)int(\d*)$/);if(t){const e=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&w.throwArgumentError("invalid numeric width","type",o);const i=R.mask(e?n-1:n),s=e?i.add(O).mul(S):C;return function(t){const e=h.from(t);return(e.lt(s)||e.gt(i))&&w.throwArgumentError(`value out-of-bounds for ${o}`,"value",t),r(e.toTwos(256).toHexString(),32)}}}{const t=o.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&w.throwArgumentError("invalid bytes width","type",o),function(t){return e(t).length!==r&&w.throwArgumentError(`invalid length for ${o}`,"value",t),function(t){const r=e(t),o=r.length%32;return o?n([r,b.slice(o)]):i(r)}(t)}}}switch(o){case"address":return function(e){return r(t(e),32)};case"bool":return function(t){return t?A:x};case"bytes":return function(t){return a(t)};case"string":return function(t){return d(t)}}return null}function $(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class P{constructor(t){c(this,"types",Object.freeze(u(t))),c(this,"_encoderCache",{}),c(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const o={};t[n].forEach((i=>{o[i.name]&&w.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&&w.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);j(s)||(r[s]||w.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const o=Object.keys(r).filter((t=>0===r[t].length));0===o.length?w.throwArgumentError("missing primary type","types",t):o.length>1&&w.throwArgumentError(`ambiguous primary types or unused types: ${o.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),c(this,"primaryType",o[0]),function o(i,s){s[i]&&w.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",t),s[i]=!0,Object.keys(e[i]).forEach((t=>{r[t]&&(o(t,s),Object.keys(s).forEach((e=>{n[e][t]=!0})))})),delete s[i]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=$(e,t[e])+r.map((e=>$(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=j(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),o=parseInt(e[3]);return e=>{o>=0&&e.length!==o&&w.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(a)),a(n(i))}}const r=this.types[t];if(r){const e=d(this._types[t]);return t=>{const o=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?a(n):n}));return o.unshift(e),n(o)}}return w.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||w.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return a(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(j(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&&w.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)),{}):w.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new P(t)}static getPrimaryType(t){return P.from(t).primaryType}static hashStruct(t,e,r){return P.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=T[r];n||w.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>k.indexOf(t.name)-k.indexOf(e.name))),P.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return n(["0x1901",P.hashDomain(t),P.from(e).hash(r)])}static hash(t,e,r){return a(P.encode(t,e,r))}static resolveNames(t,e,r,n){return E(this,void 0,void 0,(function*(){t=l(t);const i={};t.verifyingContract&&!o(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const s=P.from(e);s.visit(r,((t,e)=>("address"!==t||o(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield n(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=s.visit(r,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:r}}))}static getPayload(t,r,n){P.hashDomain(t);const o={},s=[];k.forEach((e=>{const r=t[e];null!=r&&(o[e]=I[e](r),s.push({name:e,type:T[e]}))}));const a=P.from(r),c=l(r);return c.EIP712Domain?w.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):c.EIP712Domain=s,a.encode(n),{types:c,domain:o,primaryType:a.primaryType,message:a.visit(n,((t,r)=>{if(t.match(/^bytes(\d*)/))return i(e(r));if(t.match(/^u?int/))return h.from(r).toString();switch(t){case"address":return r.toLowerCase();case"bool":return!!r;case"string":return"string"!=typeof r&&w.throwArgumentError("invalid string","value",r),r}return w.throwArgumentError("unsupported type","type",t)}))}}}var L=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 D(t,r){return L(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(new Uint8Array(i))}}))}var M=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 N=new f("web/5.7.1");function q(t){return new Promise((e=>{setTimeout(e,t)}))}function J(t,e){if(null==t)return null;if("string"==typeof t)return t;if(s(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return m(t)}catch(t){}return i(t)}return t}function B(t,e,r){const n="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;N.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const o="object"==typeof t?t.throttleCallback:null,i="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;N.assertArgument(i>0&&i%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",i);const s="object"==typeof t&&!!t.errorPassThrough,a={};let c=null;const u={method:"GET"};let h=!1,d=12e4;if("string"==typeof t)c=t;else if("object"==typeof t){if(null!=t&&null!=t.url||N.throwArgumentError("missing URL","connection.url",t),c=t.url,"number"==typeof t.timeout&&t.timeout>0&&(d=t.timeout),t.headers)for(const e in t.headers)a[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(h=!0);if(u.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==c.substring(0,6)&&!0!==t.allowInsecureAuthentication&&N.throwError("basic authentication requires a secure https url",f.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+v(y(e))}}null!=t.skipFetchSetup&&(u.skipFetchSetup=!!t.skipFetchSetup),null!=t.fetchOptions&&(u.fetchOptions=l(t.fetchOptions))}const m=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),p=c?c.match(m):null;if(p)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":p[1]||"text/plain"},body:p[2]?g(p[3]):(E=p[3],y(E.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){N.throwError("processing response error",f.errors.SERVER_ERROR,{body:J(p[1],p[2]),error:t,requestBody:null,requestMethod:"GET",url:c})}var E;e&&(u.method="POST",u.body=e,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const w={};Object.keys(a).forEach((t=>{const e=a[t];w[e.key]=e.value})),u.headers=w;const b=function(){let t=null;return{promise:new Promise((function(e,r){d&&(t=setTimeout((()=>{null!=t&&(t=null,r(N.makeError("timeout",f.errors.TIMEOUT,{requestBody:J(u.body,w["content-type"]),requestMethod:u.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),S=function(){return M(this,void 0,void 0,(function*(){for(let t=0;t<n;t++){let e=null;try{if(e=yield D(c,u),t<n)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===u.method&&t.match(/^https:/)){c=e.headers.location;continue}}else if(429===e.statusCode){let r=!0;if(o&&(r=yield o(t,c)),r){let r=0;const n=e.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):i*parseInt(String(Math.random()*Math.pow(2,t))),yield q(r);continue}}}catch(t){e=t.response,null==e&&(b.cancel(),N.throwError("missing response",f.errors.SERVER_ERROR,{requestBody:J(u.body,w["content-type"]),requestMethod:u.method,serverError:t,url:c}))}let a=e.body;if(h&&304===e.statusCode?a=null:!s&&(e.statusCode<200||e.statusCode>=300)&&(b.cancel(),N.throwError("bad response",f.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:J(a,e.headers?e.headers["content-type"]:null),requestBody:J(u.body,w["content-type"]),requestMethod:u.method,url:c})),r)try{const t=yield r(a,e);return b.cancel(),t}catch(r){if(r.throttleRetry&&t<n){let e=!0;if(o&&(e=yield o(t,c)),e){const e=i*parseInt(String(Math.random()*Math.pow(2,t)));yield q(e);continue}}b.cancel(),N.throwError("processing response error",f.errors.SERVER_ERROR,{body:J(a,e.headers?e.headers["content-type"]:null),error:r,requestBody:J(u.body,w["content-type"]),requestMethod:u.method,url:c})}return b.cancel(),a}return N.throwError("failed response",f.errors.SERVER_ERROR,{requestBody:J(u.body,w["content-type"]),requestMethod:u.method,url:c})}))}();return Promise.race([b.promise,S])}function G(t,e,r){let n=null;if(null!=e){n=y(e);const r="string"==typeof t?{url:t}:l(t);if(r.headers){0!==Object.keys(r.headers).filter((t=>"content-type"===t.toLowerCase())).length||(r.headers=l(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};t=r}return B(t,n,((t,e)=>{let n=null;if(null!=t)try{n=JSON.parse(m(t))}catch(e){N.throwError("invalid JSON",f.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function V(t,e){return e||(e={}),null==(e=l(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 z=Object.freeze({__proto__:null,_fetchData:B,fetchJson:G,poll:V});export{P as T,B as _,g as d,v as e,G as f,z as l,V as p,p as v};
@@ -0,0 +1 @@
1
+ import{g as a}from"./index-5bdb764f.js";import{C as r,E as e,a as s,F as t,b as o,P as n,c as i,A as c,d as m,I as d,f as b,e as f,L as p,T as F}from"./interface-b85b700d.js";var g=a(Object.freeze({__proto__:null,ConstructorFragment:r,ErrorFragment:e,EventFragment:s,Fragment:t,FunctionFragment:o,ParamType:n,FormatTypes:i,AbiCoder:c,defaultAbiCoder:m,Interface:d,Indexed:b,checkResultErrors:f,LogDescription:p,TransactionDescription:F}));export{g as r};