@volr/react-ui 0.1.47 → 0.1.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -6,14 +6,14 @@ var react = require('@volr/react');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var clsx = require('clsx');
8
8
  var tailwindMerge = require('tailwind-merge');
9
- var sha3 = require('@noble/hashes/sha3');
10
- var utils = require('@noble/hashes/utils');
11
9
 
12
10
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
11
 
14
12
  var React5__default = /*#__PURE__*/_interopDefault(React5);
15
13
 
16
- // src/providers/VolrUIProvider.tsx
14
+ var __defProp = Object.defineProperty;
15
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
17
17
 
18
18
  // src/i18n/locales/en.ts
19
19
  var en = {
@@ -1554,6 +1554,7 @@ function SigninSelectScreen({
1554
1554
  "div",
1555
1555
  {
1556
1556
  className: showBrandingColumn ? "volr:max-w-4xl volr:w-full volr:mx-auto volr:grid volr:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)] volr:gap-4" : "volr:max-w-md volr:w-full volr:mx-auto",
1557
+ style: showBrandingColumn ? { minHeight: "666px" } : void 0,
1557
1558
  children: [
1558
1559
  showBrandingColumn && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "volr:flex", children: /* @__PURE__ */ jsxRuntime.jsx(BrandingPanel, { config: branding }) }),
1559
1560
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1741,9 +1742,296 @@ var CopyButton = ({ text, className, onCopy }) => {
1741
1742
  }
1742
1743
  );
1743
1744
  };
1745
+
1746
+ // node_modules/@noble/hashes/_u64.js
1747
+ var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
1748
+ var _32n = /* @__PURE__ */ BigInt(32);
1749
+ function fromBig(n, le = false) {
1750
+ if (le)
1751
+ return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
1752
+ return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
1753
+ }
1754
+ function split(lst, le = false) {
1755
+ const len = lst.length;
1756
+ let Ah = new Uint32Array(len);
1757
+ let Al = new Uint32Array(len);
1758
+ for (let i = 0; i < len; i++) {
1759
+ const { h, l } = fromBig(lst[i], le);
1760
+ [Ah[i], Al[i]] = [h, l];
1761
+ }
1762
+ return [Ah, Al];
1763
+ }
1764
+ var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
1765
+ var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
1766
+ var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
1767
+ var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
1768
+
1769
+ // node_modules/@noble/hashes/utils.js
1770
+ function isBytes(a) {
1771
+ return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
1772
+ }
1773
+ function anumber(n, title = "") {
1774
+ if (!Number.isSafeInteger(n) || n < 0) {
1775
+ const prefix = title && `"${title}" `;
1776
+ throw new Error(`${prefix}expected integer >= 0, got ${n}`);
1777
+ }
1778
+ }
1779
+ function abytes(value, length, title = "") {
1780
+ const bytes = isBytes(value);
1781
+ const len = value?.length;
1782
+ const needsLen = length !== void 0;
1783
+ if (!bytes || needsLen) {
1784
+ const prefix = title && `"${title}" `;
1785
+ const ofLen = "";
1786
+ const got = bytes ? `length=${len}` : `type=${typeof value}`;
1787
+ throw new Error(prefix + "expected Uint8Array" + ofLen + ", got " + got);
1788
+ }
1789
+ return value;
1790
+ }
1791
+ function aexists(instance, checkFinished = true) {
1792
+ if (instance.destroyed)
1793
+ throw new Error("Hash instance has been destroyed");
1794
+ if (checkFinished && instance.finished)
1795
+ throw new Error("Hash#digest() has already been called");
1796
+ }
1797
+ function aoutput(out, instance) {
1798
+ abytes(out, void 0, "digestInto() output");
1799
+ const min = instance.outputLen;
1800
+ if (out.length < min) {
1801
+ throw new Error('"digestInto() output" expected to be of length >=' + min);
1802
+ }
1803
+ }
1804
+ function u32(arr) {
1805
+ return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
1806
+ }
1807
+ function clean(...arrays) {
1808
+ for (let i = 0; i < arrays.length; i++) {
1809
+ arrays[i].fill(0);
1810
+ }
1811
+ }
1812
+ var isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
1813
+ function byteSwap(word) {
1814
+ return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
1815
+ }
1816
+ function byteSwap32(arr) {
1817
+ for (let i = 0; i < arr.length; i++) {
1818
+ arr[i] = byteSwap(arr[i]);
1819
+ }
1820
+ return arr;
1821
+ }
1822
+ var swap32IfBE = isLE ? (u) => u : byteSwap32;
1823
+ var hasHexBuiltin = /* @__PURE__ */ (() => (
1824
+ // @ts-ignore
1825
+ typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function"
1826
+ ))();
1827
+ var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
1828
+ function bytesToHex(bytes) {
1829
+ abytes(bytes);
1830
+ if (hasHexBuiltin)
1831
+ return bytes.toHex();
1832
+ let hex = "";
1833
+ for (let i = 0; i < bytes.length; i++) {
1834
+ hex += hexes[bytes[i]];
1835
+ }
1836
+ return hex;
1837
+ }
1838
+ function createHasher(hashCons, info = {}) {
1839
+ const hashC = (msg, opts) => hashCons(opts).update(msg).digest();
1840
+ const tmp = hashCons(void 0);
1841
+ hashC.outputLen = tmp.outputLen;
1842
+ hashC.blockLen = tmp.blockLen;
1843
+ hashC.create = (opts) => hashCons(opts);
1844
+ Object.assign(hashC, info);
1845
+ return Object.freeze(hashC);
1846
+ }
1847
+
1848
+ // node_modules/@noble/hashes/sha3.js
1849
+ var _0n = BigInt(0);
1850
+ var _1n = BigInt(1);
1851
+ var _2n = BigInt(2);
1852
+ var _7n = BigInt(7);
1853
+ var _256n = BigInt(256);
1854
+ var _0x71n = BigInt(113);
1855
+ var SHA3_PI = [];
1856
+ var SHA3_ROTL = [];
1857
+ var _SHA3_IOTA = [];
1858
+ for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
1859
+ [x, y] = [y, (2 * x + 3 * y) % 5];
1860
+ SHA3_PI.push(2 * (5 * y + x));
1861
+ SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
1862
+ let t = _0n;
1863
+ for (let j = 0; j < 7; j++) {
1864
+ R = (R << _1n ^ (R >> _7n) * _0x71n) % _256n;
1865
+ if (R & _2n)
1866
+ t ^= _1n << (_1n << BigInt(j)) - _1n;
1867
+ }
1868
+ _SHA3_IOTA.push(t);
1869
+ }
1870
+ var IOTAS = split(_SHA3_IOTA, true);
1871
+ var SHA3_IOTA_H = IOTAS[0];
1872
+ var SHA3_IOTA_L = IOTAS[1];
1873
+ var rotlH = (h, l, s) => s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s);
1874
+ var rotlL = (h, l, s) => s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s);
1875
+ function keccakP(s, rounds = 24) {
1876
+ const B = new Uint32Array(5 * 2);
1877
+ for (let round = 24 - rounds; round < 24; round++) {
1878
+ for (let x = 0; x < 10; x++)
1879
+ B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
1880
+ for (let x = 0; x < 10; x += 2) {
1881
+ const idx1 = (x + 8) % 10;
1882
+ const idx0 = (x + 2) % 10;
1883
+ const B0 = B[idx0];
1884
+ const B1 = B[idx0 + 1];
1885
+ const Th = rotlH(B0, B1, 1) ^ B[idx1];
1886
+ const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
1887
+ for (let y = 0; y < 50; y += 10) {
1888
+ s[x + y] ^= Th;
1889
+ s[x + y + 1] ^= Tl;
1890
+ }
1891
+ }
1892
+ let curH = s[2];
1893
+ let curL = s[3];
1894
+ for (let t = 0; t < 24; t++) {
1895
+ const shift = SHA3_ROTL[t];
1896
+ const Th = rotlH(curH, curL, shift);
1897
+ const Tl = rotlL(curH, curL, shift);
1898
+ const PI = SHA3_PI[t];
1899
+ curH = s[PI];
1900
+ curL = s[PI + 1];
1901
+ s[PI] = Th;
1902
+ s[PI + 1] = Tl;
1903
+ }
1904
+ for (let y = 0; y < 50; y += 10) {
1905
+ for (let x = 0; x < 10; x++)
1906
+ B[x] = s[y + x];
1907
+ for (let x = 0; x < 10; x++)
1908
+ s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
1909
+ }
1910
+ s[0] ^= SHA3_IOTA_H[round];
1911
+ s[1] ^= SHA3_IOTA_L[round];
1912
+ }
1913
+ clean(B);
1914
+ }
1915
+ var Keccak = class _Keccak {
1916
+ // NOTE: we accept arguments in bytes instead of bits here.
1917
+ constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
1918
+ __publicField(this, "state");
1919
+ __publicField(this, "pos", 0);
1920
+ __publicField(this, "posOut", 0);
1921
+ __publicField(this, "finished", false);
1922
+ __publicField(this, "state32");
1923
+ __publicField(this, "destroyed", false);
1924
+ __publicField(this, "blockLen");
1925
+ __publicField(this, "suffix");
1926
+ __publicField(this, "outputLen");
1927
+ __publicField(this, "enableXOF", false);
1928
+ __publicField(this, "rounds");
1929
+ this.blockLen = blockLen;
1930
+ this.suffix = suffix;
1931
+ this.outputLen = outputLen;
1932
+ this.enableXOF = enableXOF;
1933
+ this.rounds = rounds;
1934
+ anumber(outputLen, "outputLen");
1935
+ if (!(0 < blockLen && blockLen < 200))
1936
+ throw new Error("only keccak-f1600 function is supported");
1937
+ this.state = new Uint8Array(200);
1938
+ this.state32 = u32(this.state);
1939
+ }
1940
+ clone() {
1941
+ return this._cloneInto();
1942
+ }
1943
+ keccak() {
1944
+ swap32IfBE(this.state32);
1945
+ keccakP(this.state32, this.rounds);
1946
+ swap32IfBE(this.state32);
1947
+ this.posOut = 0;
1948
+ this.pos = 0;
1949
+ }
1950
+ update(data) {
1951
+ aexists(this);
1952
+ abytes(data);
1953
+ const { blockLen, state } = this;
1954
+ const len = data.length;
1955
+ for (let pos = 0; pos < len; ) {
1956
+ const take = Math.min(blockLen - this.pos, len - pos);
1957
+ for (let i = 0; i < take; i++)
1958
+ state[this.pos++] ^= data[pos++];
1959
+ if (this.pos === blockLen)
1960
+ this.keccak();
1961
+ }
1962
+ return this;
1963
+ }
1964
+ finish() {
1965
+ if (this.finished)
1966
+ return;
1967
+ this.finished = true;
1968
+ const { state, suffix, pos, blockLen } = this;
1969
+ state[pos] ^= suffix;
1970
+ if ((suffix & 128) !== 0 && pos === blockLen - 1)
1971
+ this.keccak();
1972
+ state[blockLen - 1] ^= 128;
1973
+ this.keccak();
1974
+ }
1975
+ writeInto(out) {
1976
+ aexists(this, false);
1977
+ abytes(out);
1978
+ this.finish();
1979
+ const bufferOut = this.state;
1980
+ const { blockLen } = this;
1981
+ for (let pos = 0, len = out.length; pos < len; ) {
1982
+ if (this.posOut >= blockLen)
1983
+ this.keccak();
1984
+ const take = Math.min(blockLen - this.posOut, len - pos);
1985
+ out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
1986
+ this.posOut += take;
1987
+ pos += take;
1988
+ }
1989
+ return out;
1990
+ }
1991
+ xofInto(out) {
1992
+ if (!this.enableXOF)
1993
+ throw new Error("XOF is not possible for this instance");
1994
+ return this.writeInto(out);
1995
+ }
1996
+ xof(bytes) {
1997
+ anumber(bytes);
1998
+ return this.xofInto(new Uint8Array(bytes));
1999
+ }
2000
+ digestInto(out) {
2001
+ aoutput(out, this);
2002
+ if (this.finished)
2003
+ throw new Error("digest() was already called");
2004
+ this.writeInto(out);
2005
+ this.destroy();
2006
+ return out;
2007
+ }
2008
+ digest() {
2009
+ return this.digestInto(new Uint8Array(this.outputLen));
2010
+ }
2011
+ destroy() {
2012
+ this.destroyed = true;
2013
+ clean(this.state);
2014
+ }
2015
+ _cloneInto(to) {
2016
+ const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
2017
+ to || (to = new _Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
2018
+ to.state32.set(this.state32);
2019
+ to.pos = this.pos;
2020
+ to.posOut = this.posOut;
2021
+ to.finished = this.finished;
2022
+ to.rounds = rounds;
2023
+ to.suffix = suffix;
2024
+ to.outputLen = outputLen;
2025
+ to.enableXOF = enableXOF;
2026
+ to.destroyed = this.destroyed;
2027
+ return to;
2028
+ }
2029
+ };
2030
+ var genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info);
2031
+ var keccak_256 = /* @__PURE__ */ genKeccak(1, 136, 32);
1744
2032
  function toChecksumAddress(address) {
1745
2033
  const addr = address.toLowerCase().replace("0x", "");
1746
- const hash = utils.bytesToHex(sha3.keccak_256(new TextEncoder().encode(addr)));
2034
+ const hash = bytesToHex(keccak_256(new TextEncoder().encode(addr)));
1747
2035
  let checksummed = "0x";
1748
2036
  for (let i = 0; i < addr.length; i++) {
1749
2037
  if (parseInt(hash[i], 16) >= 8) {
@@ -3207,6 +3495,11 @@ async function getCurrentChainId() {
3207
3495
  });
3208
3496
  return parseInt(chainIdHex, 16);
3209
3497
  }
3498
+ /*! Bundled license information:
3499
+
3500
+ @noble/hashes/utils.js:
3501
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
3502
+ */
3210
3503
 
3211
3504
  Object.defineProperty(exports, "VolrProvider", {
3212
3505
  enumerable: true,