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