@dodoex/wallet-web3 0.0.43-16 → 0.0.43-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 (130) hide show
  1. package/dist/DefaultJsonRpcProvider-cbd850bc.js +1 -0
  2. package/dist/__node-resolve_empty-c07e04b2.js +1 -0
  3. package/dist/__tslib-54b019af.js +1 -0
  4. package/dist/alchemy-provider-5870b6fa-077754c5.js +1 -0
  5. package/dist/alchemy-websocket-provider-213da986-3bfbc710.js +1 -0
  6. package/dist/blocto-46848faf.js +1 -0
  7. package/dist/bn-27b74013.js +1 -0
  8. package/dist/browser-ponyfill-9983e3af.js +1 -0
  9. package/dist/ccip-54b3b540.js +1 -0
  10. package/dist/cjs/DefaultJsonRpcProvider-4b2cbac3.cjs +1 -0
  11. package/dist/cjs/__node-resolve_empty-d89e5abe.cjs +1 -0
  12. package/dist/cjs/__tslib-2cb2dc52.cjs +1 -0
  13. package/dist/cjs/alchemy-provider-5870b6fa-1e0f04fc.cjs +1 -0
  14. package/dist/cjs/alchemy-websocket-provider-213da986-14086d26.cjs +1 -0
  15. package/dist/cjs/blocto-b08bae37.cjs +1 -0
  16. package/dist/cjs/bn-2fd35ed6.cjs +1 -0
  17. package/dist/cjs/browser-ponyfill-479139d5.cjs +1 -0
  18. package/dist/cjs/ccip-ffbee020.cjs +1 -0
  19. package/dist/cjs/{draggabilly-6ecd1d28.cjs → draggabilly-9347a024.cjs} +1 -1
  20. package/dist/cjs/ethers-6c134a78.cjs +1 -0
  21. package/dist/cjs/id-306822a4.cjs +1 -0
  22. package/dist/cjs/index-0c3f7f0d.cjs +1 -0
  23. package/dist/cjs/index-0e02422e.cjs +1 -0
  24. package/dist/{index-0513e323.js → cjs/index-123203f3.cjs} +2 -2
  25. package/dist/cjs/index-21f1272b.cjs +1 -0
  26. package/dist/cjs/index-3ee0c164.cjs +15 -0
  27. package/dist/cjs/index-449eebb0.cjs +1 -0
  28. package/dist/cjs/index-4b751ebb.cjs +9 -0
  29. package/dist/cjs/index-584ce2f2.cjs +1 -0
  30. package/dist/cjs/index-630bda42.cjs +1 -0
  31. package/dist/cjs/index-891edc27.cjs +6 -0
  32. package/dist/cjs/{index-cd2ab657.cjs → index-a4d7eb55.cjs} +2 -2
  33. package/dist/cjs/index-c8612d96.cjs +20 -0
  34. package/dist/cjs/index-d890bb01.cjs +1 -0
  35. package/dist/cjs/index-e373c760.cjs +1 -0
  36. package/dist/cjs/index.cjs +1 -1
  37. package/dist/cjs/index.es-1a08ac77.cjs +9 -0
  38. package/dist/cjs/{interface-aa401a68.cjs → interface-ca8f7e00.cjs} +1 -1
  39. package/dist/cjs/{lib-typedarrays-e12c64c0.cjs → lib-typedarrays-b3b1a9b2.cjs} +1 -1
  40. package/dist/cjs/{portis-bcfda7d2.cjs → portis-2628aa40.cjs} +1 -1
  41. package/dist/cjs/provider-ed5b8d31.cjs +1 -0
  42. package/dist/cjs/providers/connector/alchemy/index.d.ts +0 -778
  43. package/dist/cjs/providers/connector/alchemy/provider.d.ts +45 -819
  44. package/dist/cjs/providers/connector/index.d.ts +0 -776
  45. package/dist/cjs/providers/connector/types.d.ts +3 -1
  46. package/dist/cjs/providers/wallets/standalone.d.ts +0 -1
  47. package/dist/cjs/rainbow-66ff0e60.cjs +1 -0
  48. package/dist/cjs/{sha224-e12b762e.cjs → sha224-e08c8475.cjs} +1 -1
  49. package/dist/cjs/sha256-ff3785f0.cjs +1 -0
  50. package/dist/cjs/uAuth-1c63d29f.cjs +1 -0
  51. package/dist/cjs/walletConnect-c94a63a7.cjs +1 -0
  52. package/dist/cjs/walletLink-24367174.cjs +3 -0
  53. package/dist/{draggabilly-498d38e9.js → draggabilly-e394dd03.js} +1 -1
  54. package/dist/ethers-33678100.js +1 -0
  55. package/dist/id-66098a37.js +1 -0
  56. package/dist/index-1fae0e53.js +1 -0
  57. package/dist/index-27bb4d53.js +1 -0
  58. package/dist/index-493358d6.js +1 -0
  59. package/dist/index-4f7c4b45.js +1 -0
  60. package/dist/{index-718c48ae.js → index-578e2937.js} +2 -2
  61. package/dist/index-5b79ce49.js +1 -0
  62. package/dist/index-6aa8c5c1.js +1 -0
  63. package/dist/index-75067bb0.js +15 -0
  64. package/dist/index-76c2f135.js +9 -0
  65. package/dist/index-81e6d2c8.js +20 -0
  66. package/dist/index-9dc69b05.js +1 -0
  67. package/dist/{cjs/index-0ee34d28.cjs → index-cd748d86.js} +2 -2
  68. package/dist/index-fb276f03.js +1 -0
  69. package/dist/{index-c4a6d64e.js → index-fe4c3da3.js} +2 -2
  70. package/dist/index.es-79e3646d.js +9 -0
  71. package/dist/index.js +1 -1
  72. package/dist/{interface-b846e20f.js → interface-2be6959d.js} +1 -1
  73. package/dist/{lib-typedarrays-76dcbec2.js → lib-typedarrays-0fb1b85c.js} +1 -1
  74. package/dist/{portis-1045f78a.js → portis-61fd1e59.js} +1 -1
  75. package/dist/provider-5ae74ef7.js +1 -0
  76. package/dist/providers/connector/alchemy/index.d.ts +0 -778
  77. package/dist/providers/connector/alchemy/provider.d.ts +45 -819
  78. package/dist/providers/connector/index.d.ts +0 -776
  79. package/dist/providers/connector/types.d.ts +3 -1
  80. package/dist/providers/wallets/standalone.d.ts +0 -1
  81. package/dist/rainbow-5edcbe7e.js +1 -0
  82. package/dist/sha224-ad024e21.js +1 -0
  83. package/dist/sha256-2a311540.js +1 -0
  84. package/dist/uAuth-70cae622.js +1 -0
  85. package/dist/walletConnect-526a0eb4.js +1 -0
  86. package/dist/{walletLink-84b7e914.js → walletLink-518a0d96.js} +2 -2
  87. package/package.json +8 -8
  88. package/dist/__tslib-7e1f95aa.js +0 -1
  89. package/dist/alchemy-provider-5870b6fa-0a352288.js +0 -1
  90. package/dist/alchemy-websocket-provider-213da986-395a73e5.js +0 -1
  91. package/dist/blocto-c9c400e3.js +0 -1
  92. package/dist/ccip-6bd0c6dd.js +0 -1
  93. package/dist/cjs/__tslib-65cfee6e.cjs +0 -1
  94. package/dist/cjs/alchemy-provider-5870b6fa-fcd41853.cjs +0 -1
  95. package/dist/cjs/alchemy-websocket-provider-213da986-caaf1af8.cjs +0 -1
  96. package/dist/cjs/blocto-8d29cd04.cjs +0 -1
  97. package/dist/cjs/ccip-b74ac658.cjs +0 -1
  98. package/dist/cjs/id-d2c2876b.cjs +0 -1
  99. package/dist/cjs/index-16cff674.cjs +0 -1
  100. package/dist/cjs/index-25304bed.cjs +0 -15
  101. package/dist/cjs/index-3e9b2c6d.cjs +0 -1
  102. package/dist/cjs/index-69a8663c.cjs +0 -1
  103. package/dist/cjs/index-85db795c.cjs +0 -6
  104. package/dist/cjs/index-908bd0e0.cjs +0 -28
  105. package/dist/cjs/index-bdfc10b7.cjs +0 -1
  106. package/dist/cjs/index-f3bb4b9f.cjs +0 -1
  107. package/dist/cjs/index.es-1ee6dff8.cjs +0 -9
  108. package/dist/cjs/provider-9671b91b.cjs +0 -1
  109. package/dist/cjs/rainbow-bffeca67.cjs +0 -1
  110. package/dist/cjs/sha256-87b3a64e.cjs +0 -1
  111. package/dist/cjs/typed-data-d8785f60.cjs +0 -1
  112. package/dist/cjs/uAuth-a31a7652.cjs +0 -1
  113. package/dist/cjs/walletConnect-0dfe31e9.cjs +0 -1
  114. package/dist/cjs/walletLink-81174e2e.cjs +0 -3
  115. package/dist/id-63f07629.js +0 -1
  116. package/dist/index-112c8642.js +0 -15
  117. package/dist/index-30305fa2.js +0 -1
  118. package/dist/index-7cb61612.js +0 -1
  119. package/dist/index-892198b7.js +0 -1
  120. package/dist/index-8ec766b6.js +0 -28
  121. package/dist/index-a09a186c.js +0 -1
  122. package/dist/index-ae7aa0ff.js +0 -1
  123. package/dist/index.es-37c96e8d.js +0 -9
  124. package/dist/provider-e830c3fd.js +0 -1
  125. package/dist/rainbow-ff982597.js +0 -1
  126. package/dist/sha224-59fa256e.js +0 -1
  127. package/dist/sha256-523c7af1.js +0 -1
  128. package/dist/typed-data-0b589cba.js +0 -1
  129. package/dist/uAuth-1dd65c6f.js +0 -1
  130. package/dist/walletConnect-f4aa9a5e.js +0 -1
@@ -0,0 +1 @@
1
+ var e={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,r,s,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var c=new o(r,s||e,i),f=n?n+t:t;return e._events[f]?e._events[f].fn?e._events[f]=[e._events[f],c]:e._events[f].push(c):(e._events[f]=c,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function c(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),c.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},c.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,s=r.length,i=new Array(s);o<s;o++)i[o]=r[o].fn;return i},c.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},c.prototype.emit=function(e,t,r,o,s,i){var c=n?n+e:e;if(!this._events[c])return!1;var f,a,u=this._events[c],v=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),v){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,s),!0;case 6:return u.fn.call(u.context,t,r,o,s,i),!0}for(a=1,f=new Array(v-1);a<v;a++)f[a-1]=arguments[a];u.fn.apply(u.context,f)}else{var p,l=u.length;for(a=0;a<l;a++)switch(u[a].once&&this.removeListener(e,u[a].fn,void 0,!0),v){case 1:u[a].fn.call(u[a].context);break;case 2:u[a].fn.call(u[a].context,t);break;case 3:u[a].fn.call(u[a].context,t,r);break;case 4:u[a].fn.call(u[a].context,t,r,o);break;default:if(!f)for(p=1,f=new Array(v-1);p<v;p++)f[p-1]=arguments[p];u[a].fn.apply(u[a].context,f)}}return!0},c.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,r,o){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return i(this,s),this;var c=this._events[s];if(c.fn)c.fn!==t||o&&!c.once||r&&c.context!==r||i(this,s);else{for(var f=0,a=[],u=c.length;f<u;f++)(c[f].fn!==t||o&&!c[f].once||r&&c[f].context!==r)&&a.push(c[f]);a.length?this._events[s]=1===a.length?a[0]:a:i(this,s)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&i(this,t)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c}(e);var t=e.exports;export{t as u};
@@ -0,0 +1 @@
1
+ import{getAddress as e}from"@ethersproject/address";import{Provider as t}from"@ethersproject/abstract-provider";import{Signer as r}from"@ethersproject/abstract-signer";import{hexZeroPad as n,arrayify as i,isBytes as o,concat as a,hexlify as f,hexDataLength as s,splitSignature as u,hexDataSlice as d,joinSignature as l,isHexString as h}from"@ethersproject/bytes";import{k as c}from"./index-76c2f135.js";import{L as p,v as m,B as g,f as y,t as b,i as v,U as S}from"./id-66098a37.js";import{T as w}from"./index-1fae0e53.js";import{defineReadOnly as A,resolveProperties as x}from"@ethersproject/properties";import{B as P}from"./bn-27b74013.js";import{h as E}from"./hash-b468659c.js";import{computeAddress as I,serialize as M,recoverAddress as C}from"@ethersproject/transactions";import{encryptKeystore as R,decryptJsonWallet as k,decryptJsonWalletSync as _}from"@ethersproject/json-wallets";const T=new p(m),F={},D=g.from(0),B=g.from(-1);function N(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),T.throwError(e,p.errors.NUMERIC_FAULT,i)}let L="0";for(;L.length<256;)L+=L;function O(e){if("number"!=typeof e)try{e=g.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+L.substring(0,e):T.throwArgumentError("invalid decimal size","decimals",e)}function K(e,t){null==t&&(t=0);const r=O(t),n=(e=g.from(e)).lt(D);n&&(e=e.mul(B));let i=e.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=e.div(r).toString();return e=1===r.length?o:o+"."+i,n&&(e="-"+e),e}function q(e,t){null==t&&(t=0);const r=O(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||T.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&T.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&T.throwArgumentError("too many decimal points","value",e);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&N("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<r.length-1;)a+="0";const f=g.from(o),s=g.from(a);let u=f.mul(r).add(s);return n&&(u=u.mul(B)),u}class z{constructor(e,t,r,n){e!==F&&T.throwError("cannot use FixedFormat constructor; use FixedFormat.from",p.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=O(n),Object.freeze(this)}static from(e){if(e instanceof z)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||T.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],r=parseInt(i[2]),n=parseInt(i[3])}else if(e){const i=(t,r,n)=>null==e[t]?n:(typeof e[t]!==r&&T.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&T.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&T.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new z(F,t,r,n)}}class W{constructor(e,t,r,n){e!==F&&T.throwError("cannot use FixedNumber constructor; use FixedNumber.from",p.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&T.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=q(this._value,this.format.decimals),r=q(e._value,e.format.decimals);return W.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=q(this._value,this.format.decimals),r=q(e._value,e.format.decimals);return W.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=q(this._value,this.format.decimals),r=q(e._value,e.format.decimals);return W.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=q(this._value,this.format.decimals),r=q(e._value,e.format.decimals);return W.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=W.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(G.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=W.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(G.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&T.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=W.from("1"+L.substring(0,e),this.format),n=H.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&T.throwArgumentError("invalid byte width","width",e);const t=g.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return n(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return W.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||y(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),W.fromString(K(e,t),z.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=z.from(t),i=q(e,r.decimals);!r.signed&&i.lt(D)&&N("unsigned value cannot be negative","overflow","value",e);let o=null;r.signed?o=i.toTwos(r.width).toHexString():(o=i.toHexString(),o=n(o,r.width/8));const a=K(i,r.decimals);return new W(F,o,a,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=z.from(t);if(i(e).length>r.width/8)throw new Error("overflow");let n=g.from(e);r.signed&&(n=n.fromTwos(r.width));const o=n.toTwos((r.signed?0:1)+r.width).toHexString(),a=K(n,r.decimals);return new W(F,o,a,r)}static from(e,t){if("string"==typeof e)return W.fromString(e,t);if(o(e))return W.fromBytes(e,t);try{return W.fromValue(e,0,t)}catch(e){if(e.code!==p.errors.INVALID_ARGUMENT)throw e}return T.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const G=W.from(1),H=W.from("0.5"),U="Ethereum Signed Message:\n";function V(e){return"string"==typeof e&&(e=b(e)),c(a([b(U),b(String(e.length)),e]))}class j{constructor(e){A(this,"alphabet",e),A(this,"base",e.length),A(this,"_alphabetMap",{}),A(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=i(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let n=t[e];for(let e=0;e<r.length;++e)n+=r[e]<<8,r[e]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e<t.length-1;++e)n+=this._leader;for(let e=r.length-1;e>=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let i=n;for(let e=0;e<t.length;++e)i+=t[e]*this.base,t[e]=255&i,i>>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return i(new Uint8Array(t.reverse()))}}const J=new j("abcdefghijklmnopqrstuvwxyz234567"),X=new j("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var $,Y=Object.freeze({__proto__:null,BaseX:j,Base32:J,Base58:X});!function(e){e.sha256="sha256",e.sha512="sha512"}($||($={}));const Q=new p("sha2/5.7.0");function Z(e){return"0x"+E.ripemd160().update(i(e)).digest("hex")}function ee(e){return"0x"+E.sha256().update(i(e)).digest("hex")}function te(e){return"0x"+E.sha512().update(i(e)).digest("hex")}function re(e,t,r){return $[e]||Q.throwError("unsupported algorithm "+e,p.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+E.hmac(E[e],i(t)).update(i(r)).digest("hex")}function ne(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var ie=oe;function oe(e,t){if(!e)throw new Error(t||"Assertion failed")}oe.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var ae=ne((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),fe=ne((function(e,t){var r=t;r.assert=ie,r.toArray=ae.toArray,r.zero2=ae.zero2,r.toHex=ae.toHex,r.encode=ae.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<n.length;a++){var f,s=o.andln(i-1);o.isOdd()?(f=s>(i>>1)-1?(i>>1)-s:s,o.isubn(f)):f=0,n[a]=f,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,f,s=e.andln(3)+i&3,u=t.andln(3)+o&3;3===s&&(s=-1),3===u&&(u=-1),a=0==(1&s)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?s:-s,r[0].push(a),f=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==s?u:-u,r[1].push(f),2*i===a+1&&(i=1-i),2*o===f+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new P(e,"hex","le")}})),se=fe.getNAF,ue=fe.getJSF,de=fe.assert;function le(e,t){this.type=e,this.p=new P(t.p,16),this.red=t.prime?P.red(t.prime):P.mont(this.p),this.zero=new P(0).toRed(this.red),this.one=new P(1).toRed(this.red),this.two=new P(2).toRed(this.red),this.n=t.n&&new P(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var he=le;function ce(e,t){this.curve=e,this.type=t,this.precomputed=null}le.prototype.point=function(){throw new Error("Not implemented")},le.prototype.validate=function(){throw new Error("Not implemented")},le.prototype._fixedNafMul=function(e,t){de(e.precomputed);var r=e._getDoubles(),n=se(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,a,f=[];for(o=0;o<n.length;o+=r.step){a=0;for(var s=o+r.step-1;s>=o;s--)a=(a<<1)+n[s];f.push(a)}for(var u=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=i;l>0;l--){for(o=0;o<f.length;o++)(a=f[o])===l?d=d.mixedAdd(r.points[o]):a===-l&&(d=d.mixedAdd(r.points[o].neg()));u=u.add(d)}return u.toP()},le.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=se(t,r,this._bitLength),a=this.jpoint(null,null,null),f=o.length-1;f>=0;f--){for(var s=0;f>=0&&0===o[f];f--)s++;if(f>=0&&s++,a=a.dblp(s),f<0)break;var u=o[f];de(0!==u),a="affine"===e.type?u>0?a.mixedAdd(i[u-1>>1]):a.mixedAdd(i[-u-1>>1].neg()):u>0?a.add(i[u-1>>1]):a.add(i[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},le.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,f,s=this._wnafT1,u=this._wnafT2,d=this._wnafT3,l=0;for(o=0;o<n;o++){var h=(f=t[o])._getNAFPoints(e);s[o]=h.wnd,u[o]=h.points}for(o=n-1;o>=1;o-=2){var c=o-1,p=o;if(1===s[c]&&1===s[p]){var m=[t[c],null,null,t[p]];0===t[c].y.cmp(t[p].y)?(m[1]=t[c].add(t[p]),m[2]=t[c].toJ().mixedAdd(t[p].neg())):0===t[c].y.cmp(t[p].y.redNeg())?(m[1]=t[c].toJ().mixedAdd(t[p]),m[2]=t[c].add(t[p].neg())):(m[1]=t[c].toJ().mixedAdd(t[p]),m[2]=t[c].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=ue(r[c],r[p]);for(l=Math.max(y[0].length,l),d[c]=new Array(l),d[p]=new Array(l),a=0;a<l;a++){var b=0|y[0][a],v=0|y[1][a];d[c][a]=g[3*(b+1)+(v+1)],d[p][a]=0,u[c]=m}}else d[c]=se(r[c],s[c],this._bitLength),d[p]=se(r[p],s[p],this._bitLength),l=Math.max(d[c].length,l),l=Math.max(d[p].length,l)}var S=this.jpoint(null,null,null),w=this._wnafT4;for(o=l;o>=0;o--){for(var A=0;o>=0;){var x=!0;for(a=0;a<n;a++)w[a]=0|d[a][o],0!==w[a]&&(x=!1);if(!x)break;A++,o--}if(o>=0&&A++,S=S.dblp(A),o<0)break;for(a=0;a<n;a++){var P=w[a];0!==P&&(P>0?f=u[a][P-1>>1]:P<0&&(f=u[a][-P-1>>1].neg()),S="affine"===f.type?S.mixedAdd(f):S.add(f))}}for(o=0;o<n;o++)u[o]=null;return i?S:S.toP()},le.BasePoint=ce,ce.prototype.eq=function(){throw new Error("Not implemented")},ce.prototype.validate=function(){return this.curve.validate(this)},le.prototype.decodePoint=function(e,t){e=fe.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?de(e[e.length-1]%2==0):7===e[0]&&de(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},ce.prototype.encodeCompressed=function(e){return this.encode(e,!0)},ce.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},ce.prototype.encode=function(e,t){return fe.encode(this._encode(t),e)},ce.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},ce.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},ce.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},ce.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},ce.prototype._getBeta=function(){return null},ce.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var pe=ne((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),me=fe.assert;function ge(e){he.call(this,"short",e),this.a=new P(e.a,16).toRed(this.red),this.b=new P(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}pe(ge,he);var ye=ge;function be(e,t,r,n){he.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new P(t,16),this.y=new P(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function ve(e,t,r,n){he.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new P(0)):(this.x=new P(t,16),this.y=new P(r,16),this.z=new P(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}ge.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new P(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new P(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],me(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new P(e.a,16),b:new P(e.b,16)}})):this._getEndoBasis(r)}}},ge.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:P.mont(e),r=new P(2).toRed(t).redInvm(),n=r.redNeg(),i=new P(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},ge.prototype._getEndoBasis=function(e){for(var t,r,n,i,o,a,f,s,u,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,h=this.n.clone(),c=new P(1),p=new P(0),m=new P(0),g=new P(1),y=0;0!==l.cmpn(0);){var b=h.div(l);s=h.sub(b.mul(l)),u=m.sub(b.mul(c));var v=g.sub(b.mul(p));if(!n&&s.cmp(d)<0)t=f.neg(),r=c,n=s.neg(),i=u;else if(n&&2==++y)break;f=s,h=l,l=s,m=c,c=u,g=p,p=v}o=s.neg(),a=u;var S=n.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(S)>=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},ge.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),f=o.mul(n.a),s=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(f),k2:s.add(u).neg()}},ge.prototype.pointFromX=function(e,t){(e=new P(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},ge.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},ge.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),f=e[o],s=f._getBeta();a.k1.negative&&(a.k1.ineg(),f=f.neg(!0)),a.k2.negative&&(a.k2.ineg(),s=s.neg(!0)),n[2*o]=f,n[2*o+1]=s,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),d=0;d<2*o;d++)n[d]=null,i[d]=null;return u},pe(be,he.BasePoint),ge.prototype.point=function(e,t,r){return new be(this,e,t,r)},ge.prototype.pointFromJSON=function(e,t){return be.fromJSON(this,e,t)},be.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},be.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},be.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},be.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},be.prototype.isInfinity=function(){return this.inf},be.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},be.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},be.prototype.getX=function(){return this.x.fromRed()},be.prototype.getY=function(){return this.y.fromRed()},be.prototype.mul=function(e){return e=new P(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},be.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},be.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},be.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},be.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},be.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},pe(ve,he.BasePoint),ge.prototype.jpoint=function(e,t,r){return new ve(this,e,t,r)},ve.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},ve.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},ve.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),f=n.redSub(i),s=o.redSub(a);if(0===f.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=f.redSqr(),d=u.redMul(f),l=n.redMul(u),h=s.redSqr().redIAdd(d).redISub(l).redISub(l),c=s.redMul(l.redISub(h)).redISub(o.redMul(d)),p=this.z.redMul(e.z).redMul(f);return this.curve.jpoint(h,c,p)},ve.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),f=i.redSub(o);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),u=s.redMul(a),d=r.redMul(s),l=f.redSqr().redIAdd(u).redISub(d).redISub(d),h=f.redMul(d.redISub(l)).redISub(i.redMul(u)),c=this.z.redMul(a);return this.curve.jpoint(l,h,c)},ve.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,f=this.z,s=f.redSqr().redSqr(),u=a.redAdd(a);for(t=0;t<e;t++){var d=o.redSqr(),l=u.redSqr(),h=l.redSqr(),c=d.redAdd(d).redIAdd(d).redIAdd(n.redMul(s)),p=o.redMul(l),m=c.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),y=c.redMul(g);y=y.redIAdd(y).redISub(h);var b=u.redMul(f);t+1<e&&(s=s.redMul(h)),o=m,f=b,u=y}return this.curve.jpoint(o,u.redMul(i),f)},ve.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},ve.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var f=n.redAdd(n).redIAdd(n),s=f.redSqr().redISub(a).redISub(a),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=s,t=f.redMul(a.redISub(s)).redISub(u),r=this.y.redAdd(this.y)}else{var d=this.x.redSqr(),l=this.y.redSqr(),h=l.redSqr(),c=this.x.redAdd(l).redSqr().redISub(d).redISub(h);c=c.redIAdd(c);var p=d.redAdd(d).redIAdd(d),m=p.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(c).redISub(c),t=p.redMul(c.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},ve.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var f=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),s=f.redSqr().redISub(a).redISub(a);e=s;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=f.redMul(a.redISub(s)).redISub(u),r=this.y.redAdd(this.y)}else{var d=this.z.redSqr(),l=this.y.redSqr(),h=this.x.redMul(l),c=this.x.redSub(d).redMul(this.x.redAdd(d));c=c.redAdd(c).redIAdd(c);var p=h.redIAdd(h),m=(p=p.redIAdd(p)).redAdd(p);e=c.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(d);var g=l.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=c.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},ve.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),f=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),s=t.redAdd(t),u=(s=s.redIAdd(s)).redMul(a),d=f.redSqr().redISub(u.redAdd(u)),l=u.redISub(d),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var c=f.redMul(l).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(d,c,p)},ve.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),f=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),s=n.redIAdd(n);s=(s=(s=s.redIAdd(s)).redIAdd(s)).redIAdd(s);var u=i.redIAdd(a).redSqr().redISub(o).redISub(f).redISub(s),d=t.redMul(u);d=(d=d.redIAdd(d)).redIAdd(d);var l=this.x.redMul(f).redISub(d);l=(l=l.redIAdd(l)).redIAdd(l);var h=this.y.redMul(u.redMul(s.redISub(u)).redISub(a.redMul(f)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var c=this.z.redAdd(a).redSqr().redISub(r).redISub(f);return this.curve.jpoint(l,h,c)},ve.prototype.mul=function(e,t){return e=new P(e,t),this.curve._wnafMul(this,e)},ve.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},ve.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},ve.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},ve.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Se=ne((function(e,t){var r=t;r.base=he,r.short=ye,r.mont=null,r.edwards=null})),we=ne((function(e,t){var r,n=t,i=fe.assert;function o(e){"short"===e.type?this.curve=new Se.short(e):"edwards"===e.type?this.curve=new Se.edwards(e):this.curve=new Se.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:E.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:E.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:E.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:E.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:E.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:E.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:E.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:E.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Ae(e){if(!(this instanceof Ae))return new Ae(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=ae.toArray(e.entropy,e.entropyEnc||"hex"),r=ae.toArray(e.nonce,e.nonceEnc||"hex"),n=ae.toArray(e.pers,e.persEnc||"hex");ie(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var xe=Ae;Ae.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Ae.prototype._hmac=function(){return new E.hmac(this.hash,this.K)},Ae.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Ae.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=ae.toArray(e,t),r=ae.toArray(r,n),ie(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Ae.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=ae.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(r),this._reseed++,ae.encode(o,t)};var Pe=fe.assert;function Ee(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var Ie=Ee;Ee.fromPublic=function(e,t,r){return t instanceof Ee?t:new Ee(e,{pub:t,pubEnc:r})},Ee.fromPrivate=function(e,t,r){return t instanceof Ee?t:new Ee(e,{priv:t,privEnc:r})},Ee.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Ee.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},Ee.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},Ee.prototype._importPrivate=function(e,t){this.priv=new P(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},Ee.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?Pe(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||Pe(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},Ee.prototype.derive=function(e){return e.validate()||Pe(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Ee.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},Ee.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},Ee.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Me=fe.assert;function Ce(e,t){if(e instanceof Ce)return e;this._importDER(e,t)||(Me(e.r&&e.s,"Signature without r or s"),this.r=new P(e.r,16),this.s=new P(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Re=Ce;function ke(){this.place=0}function _e(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function Te(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function Fe(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Ce.prototype._importDER=function(e,t){e=fe.toArray(e,t);var r=new ke;if(48!==e[r.place++])return!1;var n=_e(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=_e(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=_e(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var f=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new P(o),this.s=new P(f),this.recoveryParam=null,!0},Ce.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=Te(t),r=Te(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];Fe(n,t.length),(n=n.concat(t)).push(2),Fe(n,r.length);var i=n.concat(r),o=[48];return Fe(o,i.length),o=o.concat(i),fe.encode(o,e)};var De=function(){throw new Error("unsupported")},Be=fe.assert;function Ne(e){if(!(this instanceof Ne))return new Ne(e);"string"==typeof e&&(Be(Object.prototype.hasOwnProperty.call(we,e),"Unknown curve "+e),e=we[e]),e instanceof we.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Le=Ne;Ne.prototype.keyPair=function(e){return new Ie(this,e)},Ne.prototype.keyFromPrivate=function(e,t){return Ie.fromPrivate(this,e,t)},Ne.prototype.keyFromPublic=function(e,t){return Ie.fromPublic(this,e,t)},Ne.prototype.genKeyPair=function(e){e||(e={});for(var t=new xe({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||De(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new P(2));;){var i=new P(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Ne.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Ne.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new P(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),f=new xe({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),s=this.n.sub(new P(1)),u=0;;u++){var d=n.k?n.k(u):new P(f.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(s)>=0)){var l=this.g.mul(d);if(!l.isInfinity()){var h=l.getX(),c=h.umod(this.n);if(0!==c.cmpn(0)){var p=d.invm(this.n).mul(c.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(l.getY().isOdd()?1:0)|(0!==h.cmp(c)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new Re({r:c,s:p,recoveryParam:m})}}}}}},Ne.prototype.verify=function(e,t,r,n){e=this._truncateToN(new P(e,16)),r=this.keyFromPublic(r,n);var i=(t=new Re(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,f=o.invm(this.n),s=f.mul(e).umod(this.n),u=f.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(s,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(s,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Ne.prototype.recoverPubKey=function(e,t,r,n){Be((3&r)===r,"The recovery param is more than two bits"),t=new Re(t,n);var i=this.n,o=new P(e),a=t.r,f=t.s,s=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),s):this.curve.pointFromX(a,s);var d=t.r.invm(i),l=i.sub(o).mul(d).umod(i),h=f.mul(d).umod(i);return this.g.mulAdd(l,a,h)},Ne.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new Re(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Oe=ne((function(e,t){var r=t;r.version="6.5.4",r.utils=fe,r.rand=function(){throw new Error("unsupported")},r.curve=Se,r.curves=we,r.ec=Le,r.eddsa=null})).ec;const Ke=new p("signing-key/5.7.0");let qe=null;function ze(){return qe||(qe=new Oe("secp256k1")),qe}class We{constructor(e){A(this,"curve","secp256k1"),A(this,"privateKey",f(e)),32!==s(this.privateKey)&&Ke.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=ze().keyFromPrivate(i(this.privateKey));A(this,"publicKey","0x"+t.getPublic(!1,"hex")),A(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),A(this,"_isSigningKey",!0)}_addPoint(e){const t=ze().keyFromPublic(i(this.publicKey)),r=ze().keyFromPublic(i(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=ze().keyFromPrivate(i(this.privateKey)),r=i(e);32!==r.length&&Ke.throwArgumentError("bad digest length","digest",e);const o=t.sign(r,{canonical:!0});return u({recoveryParam:o.recoveryParam,r:n("0x"+o.r.toString(16),32),s:n("0x"+o.s.toString(16),32)})}computeSharedSecret(e){const t=ze().keyFromPrivate(i(this.privateKey)),r=ze().keyFromPublic(i(He(e)));return n("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function Ge(e,t){const r=u(t),n={r:i(r.r),s:i(r.s)};return"0x"+ze().recoverPubKey(i(e),n,r.recoveryParam).encode("hex",!1)}function He(e,t){const r=i(e);if(32===r.length){const e=new We(r);return t?"0x"+ze().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?f(r):"0x"+ze().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+ze().keyFromPublic(r).getPublic(!0,"hex"):f(r):Ke.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Ue=Object.freeze({__proto__:null,SigningKey:We,recoverPublicKey:Ge,computePublicKey:He});const Ve=new p("wordlists/5.7.0");class je{constructor(e){Ve.checkAbstract(new.target,je),A(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const t=[];for(let r=0;r<2048;r++){const n=e.getWord(r);if(r!==e.getWordIndex(n))return"0x";t.push(n)}return v(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}let Je=null;function Xe(e){if(null==Je&&(Je="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==je.check(e)))throw Je=null,new Error("BIP39 Wordlist for en (English) FAILED")}const $e=new class extends je{constructor(){super("en")}getWord(e){return Xe(this),Je[e]}getWordIndex(e){return Xe(this),Je.indexOf(e)}};je.register($e);const Ye={en:$e},Qe=new p("hdnode/5.7.0"),Ze=g.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),et=b("Bitcoin seed"),tt=2147483648;function rt(e){return(1<<e)-1<<8-e}function nt(e){return n(f(e),32)}function it(e){return X.encode(a([e,d(ee(ee(e)),0,4)]))}function ot(e){if(null==e)return Ye.en;if("string"==typeof e){const t=Ye[e];return null==t&&Qe.throwArgumentError("unknown locale","wordlist",e),t}return e}const at={},ft="m/44'/60'/0'/0/0";class st{constructor(e,t,r,n,i,o,a,s){if(e!==at)throw new Error("HDNode constructor cannot be called directly");if(t){const e=new We(t);A(this,"privateKey",e.privateKey),A(this,"publicKey",e.compressedPublicKey)}else A(this,"privateKey",null),A(this,"publicKey",f(r));A(this,"parentFingerprint",n),A(this,"fingerprint",d(Z(ee(this.publicKey)),0,4)),A(this,"address",I(this.publicKey)),A(this,"chainCode",i),A(this,"index",o),A(this,"depth",a),null==s?(A(this,"mnemonic",null),A(this,"path",null)):"string"==typeof s?(A(this,"mnemonic",null),A(this,"path",s)):(A(this,"mnemonic",s),A(this,"path",s.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return it(a([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",f(this.depth),this.parentFingerprint,n(f(this.index),4),this.chainCode,null!=this.privateKey?a(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new st(at,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(e&tt){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(i(this.privateKey),1),t&&(t+="'")}else r.set(i(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=i(re($.sha512,this.chainCode,r)),o=n.slice(0,32),a=n.slice(32);let s=null,u=null;if(this.privateKey)s=nt(g.from(o).add(this.privateKey).mod(Ze));else{u=new We(f(o))._addPoint(this.publicKey)}let d=t;const l=this.mnemonic;return l&&(d=Object.freeze({phrase:l.phrase,path:t,locale:l.locale||"en"})),new st(at,s,u,this.fingerprint,nt(a),e,this.depth+1,d)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e<t.length;e++){const n=t[e];if(n.match(/^[0-9]+'$/)){const e=parseInt(n.substring(0,n.length-1));if(e>=tt)throw new Error("invalid path index - "+n);r=r._derive(tt+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=tt)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=i(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=i(re($.sha512,et,r));return new st(at,nt(n.slice(0,32)),null,"0x00000000",nt(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=lt(dt(e,r=ot(r)),r),st._fromSeed(ut(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return st._fromSeed(e,null)}static fromExtendedKey(e){const t=X.decode(e);82===t.length&&it(t.slice(0,78))===e||Qe.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=f(t.slice(5,9)),i=parseInt(f(t.slice(9,13)).substring(2),16),o=f(t.slice(13,45)),a=t.slice(45,78);switch(f(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new st(at,null,f(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new st(at,f(a.slice(1)),null,n,o,i,r,null)}return Qe.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function ut(e,t){t||(t="");const r=b("mnemonic"+t,S.NFKD);return function(e,t,r,n,o){let a;e=i(e),t=i(t);let s=1;const u=new Uint8Array(n),d=new Uint8Array(t.length+4);let l,h;d.set(t);for(let f=1;f<=s;f++){d[t.length]=f>>24&255,d[t.length+1]=f>>16&255,d[t.length+2]=f>>8&255,d[t.length+3]=255&f;let c=i(re(o,e,d));a||(a=c.length,h=new Uint8Array(a),s=Math.ceil(n/a),l=n-(s-1)*a),h.set(c);for(let t=1;t<r;t++){c=i(re(o,e,c));for(let e=0;e<a;e++)h[e]^=c[e]}const p=(f-1)*a,m=f===s?l:a;u.set(i(h).slice(0,m),p)}return f(u)}(b(e,S.NFKD),r,2048,64,"sha512")}function dt(e,t){t=ot(t),Qe.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=i(new Uint8Array(Math.ceil(11*r.length/8)));let o=0;for(let e=0;e<r.length;e++){let i=t.getWordIndex(r[e].normalize("NFKD"));if(-1===i)throw new Error("invalid mnemonic");for(let e=0;e<11;e++)i&1<<10-e&&(n[o>>3]|=1<<7-o%8),o++}const a=32*r.length/3,s=rt(r.length/3);if((i(ee(n.slice(0,a/8)))[0]&s)!==(n[n.length-1]&s))throw new Error("invalid checksum");return f(n.slice(0,a/8))}function lt(e,t){if(t=ot(t),(e=i(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let t=0;t<e.length;t++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1),n+=3);const o=e.length/4,a=i(ee(e))[0]&rt(o);return r[r.length-1]<<=o,r[r.length-1]|=a>>8-o,t.join(r.map((e=>t.getWord(e))))}function ht(e,t){try{return dt(e,t),!0}catch(e){}return!1}function ct(e){return("number"!=typeof e||e<0||e>=tt||e%1)&&Qe.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}var pt=Object.freeze({__proto__:null,defaultPath:ft,HDNode:st,mnemonicToSeed:ut,mnemonicToEntropy:dt,entropyToMnemonic:lt,isValidMnemonic:ht,getAccountPath:ct});const mt=new p("random/5.7.0");const gt=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();let yt=gt.crypto||gt.msCrypto;function bt(e){(e<=0||e>1024||e%1||e!=e)&&mt.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return yt.getRandomValues(t),i(t)}yt&&yt.getRandomValues||(mt.warn("WARNING: Missing strong random number source"),yt={getRandomValues:function(e){return mt.throwError("no secure random source avaialble",p.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var vt=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function f(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,f)}s((n=n.apply(e,t||[])).next())}))};const St=new p("wallet/5.7.0");class wt extends r{constructor(r,n){if(super(),null!=(i=r)&&h(i.privateKey,32)&&null!=i.address){const t=new We(r.privateKey);if(A(this,"_signingKey",(()=>t)),A(this,"address",I(this.publicKey)),this.address!==e(r.address)&&St.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(r)){const e=r.mnemonic;A(this,"_mnemonic",(()=>({phrase:e.phrase,path:e.path||ft,locale:e.locale||"en"})));const t=this.mnemonic,n=st.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path);I(n.privateKey)!==this.address&&St.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else A(this,"_mnemonic",(()=>null))}else{if(We.isSigningKey(r))"secp256k1"!==r.curve&&St.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),A(this,"_signingKey",(()=>r));else{"string"==typeof r&&r.match(/^[0-9a-f]*$/i)&&64===r.length&&(r="0x"+r);const e=new We(r);A(this,"_signingKey",(()=>e))}A(this,"_mnemonic",(()=>null)),A(this,"address",I(this.publicKey))}var i;n&&!t.isProvider(n)&&St.throwArgumentError("invalid provider","provider",n),A(this,"provider",n||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new wt(this,e)}signTransaction(t){return x(t).then((r=>{null!=r.from&&(e(r.from)!==this.address&&St.throwArgumentError("transaction from address mismatch","transaction.from",t.from),delete r.from);const n=this._signingKey().signDigest(c(M(r)));return M(r,n)}))}signMessage(e){return vt(this,void 0,void 0,(function*(){return l(this._signingKey().signDigest(V(e)))}))}_signTypedData(e,t,r){return vt(this,void 0,void 0,(function*(){const n=yield w.resolveNames(e,t,r,(e=>(null==this.provider&&St.throwError("cannot resolve ENS names without a provider",p.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return l(this._signingKey().signDigest(w.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),R(this,e,t,r)}static createRandom(e){let t=bt(16);e||(e={}),e.extraEntropy&&(t=i(d(c(a([t,e.extraEntropy])),0,16)));const r=lt(t,e.locale);return wt.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return k(e,t,r).then((e=>new wt(e)))}static fromEncryptedJsonSync(e,t){return new wt(_(e,t))}static fromMnemonic(e,t,r){return t||(t=ft),new wt(st.fromMnemonic(e,null,r).derivePath(t))}}function At(e,t){return C(V(e),t)}function xt(e,t,r,n){return C(w.hash(e,t,r),n)}var Pt=Object.freeze({__proto__:null,Wallet:wt,verifyMessage:At,verifyTypedData:xt});const Et=new p("units/5.7.0"),It=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Mt(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Et.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const e=r.length-3;o.unshift(r.substring(e)),r=r.substring(0,e)}}return n+o.join(",")+i}function Ct(e,t){if("string"==typeof t){const e=It.indexOf(t);-1!==e&&(t=3*e)}return K(e,null!=t?t:18)}function Rt(e,t){if("string"!=typeof e&&Et.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=It.indexOf(t);-1!==e&&(t=3*e)}return q(e,null!=t?t:18)}function kt(e){return Ct(e,18)}function _t(e){return Rt(e,18)}var Tt=Object.freeze({__proto__:null,commify:Mt,formatUnits:Ct,parseUnits:Rt,formatEther:kt,parseEther:_t});export{pt as A,X as B,Ue as C,Tt as D,Pt as E,W as F,st as H,We as S,wt as W,je as a,Ct as b,Rt as c,ft as d,Mt as e,kt as f,re as g,V as h,te as i,bt as j,He as k,Ge as l,xt as m,ct as n,dt as o,_t as p,lt as q,Z as r,ee as s,ht as t,ut as u,At as v,Ye as w,$ as x,U as y,Y as z};