@use-glyph/sdk-react 1.1.1 → 1.1.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.
- package/dist/glyph-widget.umd.js +3 -3
- package/dist/index.js +154 -154
- package/package.json +17 -8
package/dist/index.js
CHANGED
|
@@ -15786,133 +15786,9 @@ const Fm = () => {
|
|
|
15786
15786
|
/* @__PURE__ */ s.jsx("span", { className: "gw-flex-1 gw-text-center", children: "Connect to Glyph" })
|
|
15787
15787
|
] }) });
|
|
15788
15788
|
});
|
|
15789
|
-
class j6 extends Sa {
|
|
15790
|
-
constructor(t, r) {
|
|
15791
|
-
super(), this.finished = !1, this.destroyed = !1, R2(t);
|
|
15792
|
-
const n = Mn(r);
|
|
15793
|
-
if (this.iHash = t.create(), typeof this.iHash.update != "function")
|
|
15794
|
-
throw new Error("Expected instance of class which extends utils.Hash");
|
|
15795
|
-
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
15796
|
-
const o = this.blockLen, a = new Uint8Array(o);
|
|
15797
|
-
a.set(n.length > o ? t.create().update(n).digest() : n);
|
|
15798
|
-
for (let i = 0; i < a.length; i++)
|
|
15799
|
-
a[i] ^= 54;
|
|
15800
|
-
this.iHash.update(a), this.oHash = t.create();
|
|
15801
|
-
for (let i = 0; i < a.length; i++)
|
|
15802
|
-
a[i] ^= 106;
|
|
15803
|
-
this.oHash.update(a), nr(a);
|
|
15804
|
-
}
|
|
15805
|
-
update(t) {
|
|
15806
|
-
return rr(this), this.iHash.update(t), this;
|
|
15807
|
-
}
|
|
15808
|
-
digestInto(t) {
|
|
15809
|
-
rr(this), r1(t, this.outputLen), this.finished = !0, this.iHash.digestInto(t), this.oHash.update(t), this.oHash.digestInto(t), this.destroy();
|
|
15810
|
-
}
|
|
15811
|
-
digest() {
|
|
15812
|
-
const t = new Uint8Array(this.oHash.outputLen);
|
|
15813
|
-
return this.digestInto(t), t;
|
|
15814
|
-
}
|
|
15815
|
-
_cloneInto(t) {
|
|
15816
|
-
t || (t = Object.create(Object.getPrototypeOf(this), {}));
|
|
15817
|
-
const { oHash: r, iHash: n, finished: o, destroyed: a, blockLen: i, outputLen: l } = this;
|
|
15818
|
-
return t = t, t.finished = o, t.destroyed = a, t.blockLen = i, t.outputLen = l, t.oHash = r._cloneInto(t.oHash), t.iHash = n._cloneInto(t.iHash), t;
|
|
15819
|
-
}
|
|
15820
|
-
clone() {
|
|
15821
|
-
return this._cloneInto();
|
|
15822
|
-
}
|
|
15823
|
-
destroy() {
|
|
15824
|
-
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
15825
|
-
}
|
|
15826
|
-
}
|
|
15827
|
-
const C6 = (e, t, r) => new j6(e, t).update(r).digest();
|
|
15828
|
-
C6.create = (e, t) => new j6(e, t);
|
|
15829
|
-
const Cp = "2.20.2", zp = () => `@wagmi/core@${Cp}`;
|
|
15830
|
-
var z6 = function(e, t, r, n) {
|
|
15831
|
-
if (r === "a" && !n) throw new TypeError("Private accessor was defined without a getter");
|
|
15832
|
-
if (typeof t == "function" ? e !== t || !n : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
15833
|
-
return r === "m" ? n : r === "a" ? n.call(e) : n ? n.value : t.get(e);
|
|
15834
|
-
}, kn, R6;
|
|
15835
|
-
class kr extends Error {
|
|
15836
|
-
get docsBaseUrl() {
|
|
15837
|
-
return "https://wagmi.sh/core";
|
|
15838
|
-
}
|
|
15839
|
-
get version() {
|
|
15840
|
-
return zp();
|
|
15841
|
-
}
|
|
15842
|
-
constructor(t, r = {}) {
|
|
15843
|
-
super(), kn.add(this), Object.defineProperty(this, "details", {
|
|
15844
|
-
enumerable: !0,
|
|
15845
|
-
configurable: !0,
|
|
15846
|
-
writable: !0,
|
|
15847
|
-
value: void 0
|
|
15848
|
-
}), Object.defineProperty(this, "docsPath", {
|
|
15849
|
-
enumerable: !0,
|
|
15850
|
-
configurable: !0,
|
|
15851
|
-
writable: !0,
|
|
15852
|
-
value: void 0
|
|
15853
|
-
}), Object.defineProperty(this, "metaMessages", {
|
|
15854
|
-
enumerable: !0,
|
|
15855
|
-
configurable: !0,
|
|
15856
|
-
writable: !0,
|
|
15857
|
-
value: void 0
|
|
15858
|
-
}), Object.defineProperty(this, "shortMessage", {
|
|
15859
|
-
enumerable: !0,
|
|
15860
|
-
configurable: !0,
|
|
15861
|
-
writable: !0,
|
|
15862
|
-
value: void 0
|
|
15863
|
-
}), Object.defineProperty(this, "name", {
|
|
15864
|
-
enumerable: !0,
|
|
15865
|
-
configurable: !0,
|
|
15866
|
-
writable: !0,
|
|
15867
|
-
value: "WagmiCoreError"
|
|
15868
|
-
});
|
|
15869
|
-
const n = r.cause instanceof kr ? r.cause.details : r.cause?.message ? r.cause.message : r.details, o = r.cause instanceof kr && r.cause.docsPath || r.docsPath;
|
|
15870
|
-
this.message = [
|
|
15871
|
-
t || "An error occurred.",
|
|
15872
|
-
"",
|
|
15873
|
-
...r.metaMessages ? [...r.metaMessages, ""] : [],
|
|
15874
|
-
...o ? [
|
|
15875
|
-
`Docs: ${this.docsBaseUrl}${o}.html${r.docsSlug ? `#${r.docsSlug}` : ""}`
|
|
15876
|
-
] : [],
|
|
15877
|
-
...n ? [`Details: ${n}`] : [],
|
|
15878
|
-
`Version: ${this.version}`
|
|
15879
|
-
].join(`
|
|
15880
|
-
`), r.cause && (this.cause = r.cause), this.details = n, this.docsPath = o, this.metaMessages = r.metaMessages, this.shortMessage = t;
|
|
15881
|
-
}
|
|
15882
|
-
walk(t) {
|
|
15883
|
-
return z6(this, kn, "m", R6).call(this, this, t);
|
|
15884
|
-
}
|
|
15885
|
-
}
|
|
15886
|
-
kn = /* @__PURE__ */ new WeakSet(), R6 = function e(t, r) {
|
|
15887
|
-
return r?.(t) ? t : t.cause ? z6(this, kn, "m", e).call(this, t.cause, r) : t;
|
|
15888
|
-
};
|
|
15889
|
-
class Rp extends kr {
|
|
15890
|
-
constructor() {
|
|
15891
|
-
super("Chain not configured."), Object.defineProperty(this, "name", {
|
|
15892
|
-
enumerable: !0,
|
|
15893
|
-
configurable: !0,
|
|
15894
|
-
writable: !0,
|
|
15895
|
-
value: "ChainNotConfiguredError"
|
|
15896
|
-
});
|
|
15897
|
-
}
|
|
15898
|
-
}
|
|
15899
|
-
class Ko extends kr {
|
|
15900
|
-
constructor() {
|
|
15901
|
-
super("Provider not found."), Object.defineProperty(this, "name", {
|
|
15902
|
-
enumerable: !0,
|
|
15903
|
-
configurable: !0,
|
|
15904
|
-
writable: !0,
|
|
15905
|
-
value: "ProviderNotFoundError"
|
|
15906
|
-
});
|
|
15907
|
-
}
|
|
15908
|
-
}
|
|
15909
|
-
async function Zp({ providerAppId: e, apiUrl: t }) {
|
|
15910
|
-
let r = await fetch(`${t}/api/v1/apps/${e}/cross-app/details`, { method: "GET", headers: { "Content-Type": "application/json" } }), { custom_connect_url: n, custom_transact_url: o, custom_api_url: a, icon_url: i, name: l } = await r.json();
|
|
15911
|
-
return { url: a, customConnectUrl: n, customTransactUrl: o, name: l, iconUrl: i };
|
|
15912
|
-
}
|
|
15913
15789
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
15914
15790
|
const fs = /* @__PURE__ */ BigInt(0), xa = /* @__PURE__ */ BigInt(1);
|
|
15915
|
-
function
|
|
15791
|
+
function kn(e, t = "") {
|
|
15916
15792
|
if (typeof e != "boolean") {
|
|
15917
15793
|
const r = t && `"${t}"`;
|
|
15918
15794
|
throw new Error(r + "expected boolean, got type=" + typeof e);
|
|
@@ -15931,21 +15807,21 @@ function Xn(e) {
|
|
|
15931
15807
|
const t = e.toString(16);
|
|
15932
15808
|
return t.length & 1 ? "0" + t : t;
|
|
15933
15809
|
}
|
|
15934
|
-
function
|
|
15810
|
+
function j6(e) {
|
|
15935
15811
|
if (typeof e != "string")
|
|
15936
15812
|
throw new Error("hex string expected, got " + typeof e);
|
|
15937
15813
|
return e === "" ? fs : BigInt("0x" + e);
|
|
15938
15814
|
}
|
|
15939
15815
|
function ho(e) {
|
|
15940
|
-
return
|
|
15816
|
+
return j6(I1(e));
|
|
15941
15817
|
}
|
|
15942
|
-
function
|
|
15943
|
-
return r1(e),
|
|
15818
|
+
function C6(e) {
|
|
15819
|
+
return r1(e), j6(I1(Uint8Array.from(e).reverse()));
|
|
15944
15820
|
}
|
|
15945
15821
|
function ps(e, t) {
|
|
15946
15822
|
return Un(e.toString(16).padStart(t * 2, "0"));
|
|
15947
15823
|
}
|
|
15948
|
-
function
|
|
15824
|
+
function z6(e, t) {
|
|
15949
15825
|
return ps(e, t).reverse();
|
|
15950
15826
|
}
|
|
15951
15827
|
function lt(e, t, r) {
|
|
@@ -15962,22 +15838,22 @@ function lt(e, t, r) {
|
|
|
15962
15838
|
throw new Error(e + " must be hex string or Uint8Array");
|
|
15963
15839
|
return n.length, n;
|
|
15964
15840
|
}
|
|
15965
|
-
const
|
|
15966
|
-
function
|
|
15967
|
-
return
|
|
15841
|
+
const Ko = (e) => typeof e == "bigint" && fs <= e;
|
|
15842
|
+
function Cp(e, t, r) {
|
|
15843
|
+
return Ko(e) && Ko(t) && Ko(r) && t <= e && e < r;
|
|
15968
15844
|
}
|
|
15969
|
-
function
|
|
15970
|
-
if (!
|
|
15845
|
+
function zp(e, t, r, n) {
|
|
15846
|
+
if (!Cp(t, r, n))
|
|
15971
15847
|
throw new Error("expected valid " + e + ": " + r + " <= n < " + n + ", got " + t);
|
|
15972
15848
|
}
|
|
15973
|
-
function
|
|
15849
|
+
function R6(e) {
|
|
15974
15850
|
let t;
|
|
15975
15851
|
for (t = 0; e > fs; e >>= xa, t += 1)
|
|
15976
15852
|
;
|
|
15977
15853
|
return t;
|
|
15978
15854
|
}
|
|
15979
15855
|
const tn = (e) => (xa << BigInt(e)) - xa;
|
|
15980
|
-
function
|
|
15856
|
+
function Rp(e, t, r) {
|
|
15981
15857
|
if (typeof e != "number" || e < 2)
|
|
15982
15858
|
throw new Error("hashLen must be a number");
|
|
15983
15859
|
if (typeof t != "number" || t < 2)
|
|
@@ -16033,6 +15909,130 @@ function Hi(e) {
|
|
|
16033
15909
|
return t.set(r, a), a;
|
|
16034
15910
|
};
|
|
16035
15911
|
}
|
|
15912
|
+
class Z6 extends Sa {
|
|
15913
|
+
constructor(t, r) {
|
|
15914
|
+
super(), this.finished = !1, this.destroyed = !1, R2(t);
|
|
15915
|
+
const n = Mn(r);
|
|
15916
|
+
if (this.iHash = t.create(), typeof this.iHash.update != "function")
|
|
15917
|
+
throw new Error("Expected instance of class which extends utils.Hash");
|
|
15918
|
+
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
15919
|
+
const o = this.blockLen, a = new Uint8Array(o);
|
|
15920
|
+
a.set(n.length > o ? t.create().update(n).digest() : n);
|
|
15921
|
+
for (let i = 0; i < a.length; i++)
|
|
15922
|
+
a[i] ^= 54;
|
|
15923
|
+
this.iHash.update(a), this.oHash = t.create();
|
|
15924
|
+
for (let i = 0; i < a.length; i++)
|
|
15925
|
+
a[i] ^= 106;
|
|
15926
|
+
this.oHash.update(a), nr(a);
|
|
15927
|
+
}
|
|
15928
|
+
update(t) {
|
|
15929
|
+
return rr(this), this.iHash.update(t), this;
|
|
15930
|
+
}
|
|
15931
|
+
digestInto(t) {
|
|
15932
|
+
rr(this), r1(t, this.outputLen), this.finished = !0, this.iHash.digestInto(t), this.oHash.update(t), this.oHash.digestInto(t), this.destroy();
|
|
15933
|
+
}
|
|
15934
|
+
digest() {
|
|
15935
|
+
const t = new Uint8Array(this.oHash.outputLen);
|
|
15936
|
+
return this.digestInto(t), t;
|
|
15937
|
+
}
|
|
15938
|
+
_cloneInto(t) {
|
|
15939
|
+
t || (t = Object.create(Object.getPrototypeOf(this), {}));
|
|
15940
|
+
const { oHash: r, iHash: n, finished: o, destroyed: a, blockLen: i, outputLen: l } = this;
|
|
15941
|
+
return t = t, t.finished = o, t.destroyed = a, t.blockLen = i, t.outputLen = l, t.oHash = r._cloneInto(t.oHash), t.iHash = n._cloneInto(t.iHash), t;
|
|
15942
|
+
}
|
|
15943
|
+
clone() {
|
|
15944
|
+
return this._cloneInto();
|
|
15945
|
+
}
|
|
15946
|
+
destroy() {
|
|
15947
|
+
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
15948
|
+
}
|
|
15949
|
+
}
|
|
15950
|
+
const P6 = (e, t, r) => new Z6(e, t).update(r).digest();
|
|
15951
|
+
P6.create = (e, t) => new Z6(e, t);
|
|
15952
|
+
const Zp = "2.20.2", Pp = () => `@wagmi/core@${Zp}`;
|
|
15953
|
+
var H6 = function(e, t, r, n) {
|
|
15954
|
+
if (r === "a" && !n) throw new TypeError("Private accessor was defined without a getter");
|
|
15955
|
+
if (typeof t == "function" ? e !== t || !n : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
15956
|
+
return r === "m" ? n : r === "a" ? n.call(e) : n ? n.value : t.get(e);
|
|
15957
|
+
}, Kn, k6;
|
|
15958
|
+
class kr extends Error {
|
|
15959
|
+
get docsBaseUrl() {
|
|
15960
|
+
return "https://wagmi.sh/core";
|
|
15961
|
+
}
|
|
15962
|
+
get version() {
|
|
15963
|
+
return Pp();
|
|
15964
|
+
}
|
|
15965
|
+
constructor(t, r = {}) {
|
|
15966
|
+
super(), Kn.add(this), Object.defineProperty(this, "details", {
|
|
15967
|
+
enumerable: !0,
|
|
15968
|
+
configurable: !0,
|
|
15969
|
+
writable: !0,
|
|
15970
|
+
value: void 0
|
|
15971
|
+
}), Object.defineProperty(this, "docsPath", {
|
|
15972
|
+
enumerable: !0,
|
|
15973
|
+
configurable: !0,
|
|
15974
|
+
writable: !0,
|
|
15975
|
+
value: void 0
|
|
15976
|
+
}), Object.defineProperty(this, "metaMessages", {
|
|
15977
|
+
enumerable: !0,
|
|
15978
|
+
configurable: !0,
|
|
15979
|
+
writable: !0,
|
|
15980
|
+
value: void 0
|
|
15981
|
+
}), Object.defineProperty(this, "shortMessage", {
|
|
15982
|
+
enumerable: !0,
|
|
15983
|
+
configurable: !0,
|
|
15984
|
+
writable: !0,
|
|
15985
|
+
value: void 0
|
|
15986
|
+
}), Object.defineProperty(this, "name", {
|
|
15987
|
+
enumerable: !0,
|
|
15988
|
+
configurable: !0,
|
|
15989
|
+
writable: !0,
|
|
15990
|
+
value: "WagmiCoreError"
|
|
15991
|
+
});
|
|
15992
|
+
const n = r.cause instanceof kr ? r.cause.details : r.cause?.message ? r.cause.message : r.details, o = r.cause instanceof kr && r.cause.docsPath || r.docsPath;
|
|
15993
|
+
this.message = [
|
|
15994
|
+
t || "An error occurred.",
|
|
15995
|
+
"",
|
|
15996
|
+
...r.metaMessages ? [...r.metaMessages, ""] : [],
|
|
15997
|
+
...o ? [
|
|
15998
|
+
`Docs: ${this.docsBaseUrl}${o}.html${r.docsSlug ? `#${r.docsSlug}` : ""}`
|
|
15999
|
+
] : [],
|
|
16000
|
+
...n ? [`Details: ${n}`] : [],
|
|
16001
|
+
`Version: ${this.version}`
|
|
16002
|
+
].join(`
|
|
16003
|
+
`), r.cause && (this.cause = r.cause), this.details = n, this.docsPath = o, this.metaMessages = r.metaMessages, this.shortMessage = t;
|
|
16004
|
+
}
|
|
16005
|
+
walk(t) {
|
|
16006
|
+
return H6(this, Kn, "m", k6).call(this, this, t);
|
|
16007
|
+
}
|
|
16008
|
+
}
|
|
16009
|
+
Kn = /* @__PURE__ */ new WeakSet(), k6 = function e(t, r) {
|
|
16010
|
+
return r?.(t) ? t : t.cause ? H6(this, Kn, "m", e).call(this, t.cause, r) : t;
|
|
16011
|
+
};
|
|
16012
|
+
class Hp extends kr {
|
|
16013
|
+
constructor() {
|
|
16014
|
+
super("Chain not configured."), Object.defineProperty(this, "name", {
|
|
16015
|
+
enumerable: !0,
|
|
16016
|
+
configurable: !0,
|
|
16017
|
+
writable: !0,
|
|
16018
|
+
value: "ChainNotConfiguredError"
|
|
16019
|
+
});
|
|
16020
|
+
}
|
|
16021
|
+
}
|
|
16022
|
+
class Yo extends kr {
|
|
16023
|
+
constructor() {
|
|
16024
|
+
super("Provider not found."), Object.defineProperty(this, "name", {
|
|
16025
|
+
enumerable: !0,
|
|
16026
|
+
configurable: !0,
|
|
16027
|
+
writable: !0,
|
|
16028
|
+
value: "ProviderNotFoundError"
|
|
16029
|
+
});
|
|
16030
|
+
}
|
|
16031
|
+
}
|
|
16032
|
+
async function kp({ providerAppId: e, apiUrl: t }) {
|
|
16033
|
+
let r = await fetch(`${t}/api/v1/apps/${e}/cross-app/details`, { method: "GET", headers: { "Content-Type": "application/json" } }), { custom_connect_url: n, custom_transact_url: o, custom_api_url: a, icon_url: i, name: l } = await r.json();
|
|
16034
|
+
return { url: a, customConnectUrl: n, customTransactUrl: o, name: l, iconUrl: i };
|
|
16035
|
+
}
|
|
16036
16036
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
16037
16037
|
const ut = BigInt(0), ot = BigInt(1), V1 = /* @__PURE__ */ BigInt(2), K6 = /* @__PURE__ */ BigInt(3), Y6 = /* @__PURE__ */ BigInt(4), G6 = /* @__PURE__ */ BigInt(5), Kp = /* @__PURE__ */ BigInt(7), J6 = /* @__PURE__ */ BigInt(8), Yp = /* @__PURE__ */ BigInt(9), D6 = /* @__PURE__ */ BigInt(16);
|
|
16038
16038
|
function Wt(e, t) {
|
|
@@ -16222,7 +16222,7 @@ function rn(e, t, r = !1, n = {}) {
|
|
|
16222
16222
|
mulN: (m, v) => m * v,
|
|
16223
16223
|
inv: (m) => ki(m, e),
|
|
16224
16224
|
sqrt: a || ((m) => (f || (f = Dp(e)), f(d, m))),
|
|
16225
|
-
toBytes: (m) => r ?
|
|
16225
|
+
toBytes: (m) => r ? z6(m, u) : ps(m, u),
|
|
16226
16226
|
fromBytes: (m, v = !0) => {
|
|
16227
16227
|
if (l) {
|
|
16228
16228
|
if (!l.includes(m.length) || m.length > u)
|
|
@@ -16232,7 +16232,7 @@ function rn(e, t, r = !1, n = {}) {
|
|
|
16232
16232
|
}
|
|
16233
16233
|
if (m.length !== u)
|
|
16234
16234
|
throw new Error("Field.fromBytes: expected " + u + " bytes, got " + m.length);
|
|
16235
|
-
let b = r ?
|
|
16235
|
+
let b = r ? C6(m) : ho(m);
|
|
16236
16236
|
if (i && (b = Wt(b, e)), !v && !d.isValid(b))
|
|
16237
16237
|
throw new Error("invalid field element: outside of range 0..ORDER");
|
|
16238
16238
|
return b;
|
|
@@ -16259,8 +16259,8 @@ function Bp(e, t, r = !1) {
|
|
|
16259
16259
|
const n = e.length, o = I6(t), a = A6(t);
|
|
16260
16260
|
if (n < 16 || n < a || n > 1024)
|
|
16261
16261
|
throw new Error("expected " + a + "-1024 bytes of input, got " + n);
|
|
16262
|
-
const i = r ?
|
|
16263
|
-
return r ?
|
|
16262
|
+
const i = r ? C6(e) : ho(e), l = Wt(i, t - ot) + ot;
|
|
16263
|
+
return r ? z6(l, o) : ps(l, o);
|
|
16264
16264
|
}
|
|
16265
16265
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
16266
16266
|
const dr = BigInt(0), O1 = BigInt(1);
|
|
@@ -16413,7 +16413,7 @@ function eh(e, t, r, n) {
|
|
|
16413
16413
|
const o = r.length, a = n.length;
|
|
16414
16414
|
if (o !== a)
|
|
16415
16415
|
throw new Error("arrays of points and scalars must have equal length");
|
|
16416
|
-
const i = e.ZERO, l =
|
|
16416
|
+
const i = e.ZERO, l = R6(BigInt(o));
|
|
16417
16417
|
let c = 1;
|
|
16418
16418
|
l > 12 ? c = l - 3 : l > 4 ? c = l - 2 : l > 0 && (c = 2);
|
|
16419
16419
|
const u = tn(c), f = new Array(Number(u) + 1).fill(i), d = Math.floor((t.BITS - 1) / c) * c;
|
|
@@ -16462,7 +16462,7 @@ function rh(e, t, r) {
|
|
|
16462
16462
|
let u = e - l * n - c * a, f = -l * o - c * i;
|
|
16463
16463
|
const d = u < $t, m = f < $t;
|
|
16464
16464
|
d && (u = -u), m && (f = -f);
|
|
16465
|
-
const v = tn(Math.ceil(
|
|
16465
|
+
const v = tn(Math.ceil(R6(r) / 2)) + er;
|
|
16466
16466
|
if (u < $t || u >= v || f < $t || f >= v)
|
|
16467
16467
|
throw new Error("splitScalar (endomorphism): failed, k=" + e);
|
|
16468
16468
|
return { k1neg: d, k1: u, k2neg: m, k2: f };
|
|
@@ -16476,7 +16476,7 @@ function Mo(e, t) {
|
|
|
16476
16476
|
const r = {};
|
|
16477
16477
|
for (let n of Object.keys(t))
|
|
16478
16478
|
r[n] = e[n] === void 0 ? t[n] : e[n];
|
|
16479
|
-
return
|
|
16479
|
+
return kn(r.lowS, "lowS"), kn(r.prehash, "prehash"), r.format !== void 0 && Na(r.format), r;
|
|
16480
16480
|
}
|
|
16481
16481
|
class nh extends Error {
|
|
16482
16482
|
constructor(t = "") {
|
|
@@ -16611,7 +16611,7 @@ function ah(e, t = {}) {
|
|
|
16611
16611
|
}
|
|
16612
16612
|
function d(J, F, Z) {
|
|
16613
16613
|
const { x: j, y: P } = F.toAffine(), k = n.toBytes(j);
|
|
16614
|
-
if (
|
|
16614
|
+
if (kn(Z, "isCompressed"), Z) {
|
|
16615
16615
|
f();
|
|
16616
16616
|
const R = !n.isOdd(P);
|
|
16617
16617
|
return d1(t0(R), k);
|
|
@@ -16863,7 +16863,7 @@ function ah(e, t = {}) {
|
|
|
16863
16863
|
return this.multiplyUnsafe(i).is0();
|
|
16864
16864
|
}
|
|
16865
16865
|
toBytes(F = !0) {
|
|
16866
|
-
return
|
|
16866
|
+
return kn(F, "isCompressed"), this.assertValidity(), v(C, this, F);
|
|
16867
16867
|
}
|
|
16868
16868
|
toHex(F = !0) {
|
|
16869
16869
|
return I1(this.toBytes(F));
|
|
@@ -16981,7 +16981,7 @@ function ih(e, t, r = {}) {
|
|
|
16981
16981
|
bits2int: "function",
|
|
16982
16982
|
bits2int_modN: "function"
|
|
16983
16983
|
});
|
|
16984
|
-
const n = r.randomBytes || k2, o = r.hmac || ((Z, ...j) =>
|
|
16984
|
+
const n = r.randomBytes || k2, o = r.hmac || ((Z, ...j) => P6(t, Z, d1(...j))), { Fp: a, Fn: i } = e, { ORDER: l, BITS: c } = i, { keygen: u, getPublicKey: f, getSharedSecret: d, utils: m, lengths: v } = sh(e, r), b = {
|
|
16985
16985
|
prehash: !1,
|
|
16986
16986
|
lowS: typeof r.lowS == "boolean" ? r.lowS : !1,
|
|
16987
16987
|
format: void 0,
|
|
@@ -17089,7 +17089,7 @@ function ih(e, t, r = {}) {
|
|
|
17089
17089
|
return i.create(L(j));
|
|
17090
17090
|
}, H = tn(c);
|
|
17091
17091
|
function z(Z) {
|
|
17092
|
-
return
|
|
17092
|
+
return zp("num < 2^" + c, Z, $t, H), i.toBytes(Z);
|
|
17093
17093
|
}
|
|
17094
17094
|
function T(Z, j) {
|
|
17095
17095
|
return L1(Z, void 0, "message"), j ? L1(t(Z), void 0, "prehashed message") : Z;
|
|
@@ -17123,7 +17123,7 @@ function ih(e, t, r = {}) {
|
|
|
17123
17123
|
function B(Z, j, P = {}) {
|
|
17124
17124
|
Z = lt("message", Z);
|
|
17125
17125
|
const { seed: k, k2sig: R } = C(Z, j, P);
|
|
17126
|
-
return
|
|
17126
|
+
return Rp(t.outputLen, i.BYTES, o)(k, R);
|
|
17127
17127
|
}
|
|
17128
17128
|
function A(Z) {
|
|
17129
17129
|
let j;
|
|
@@ -18997,7 +18997,7 @@ let Ah = class {
|
|
|
18997
18997
|
}
|
|
18998
18998
|
async loadProviderDetails() {
|
|
18999
18999
|
if (!this._providerDetailsLoaded) {
|
|
19000
|
-
let { url: t, customConnectUrl: r, customTransactUrl: n } = await
|
|
19000
|
+
let { url: t, customConnectUrl: r, customTransactUrl: n } = await kp({ providerAppId: this.providerAppId, apiUrl: this._apiUrl });
|
|
19001
19001
|
this._providerConnectUrl = r || `${t}/cross-app/connect`, this._providerTransactUrl = n || `${t}/cross-app/transact`, this._providerDetailsLoaded = !0;
|
|
19002
19002
|
}
|
|
19003
19003
|
}
|
|
@@ -19101,11 +19101,11 @@ function h0(e, t) {
|
|
|
19101
19101
|
n && (c.removeListener("chainChanged", n), n = void 0), a && (c.removeListener("disconnect", a), a = void 0), o || (o = this.onConnect.bind(this), c.on("connect", o)), await c.request({ method: "wallet_revokePermissions", params: [{ eth_accounts: {} }] }), this.onDisconnect();
|
|
19102
19102
|
}, async getAccounts() {
|
|
19103
19103
|
let c = await this.getProvider();
|
|
19104
|
-
if (!c) throw new
|
|
19104
|
+
if (!c) throw new Yo();
|
|
19105
19105
|
return (await c.request({ method: "eth_accounts" })).map(((u) => Xs(u)));
|
|
19106
19106
|
}, async getChainId() {
|
|
19107
19107
|
let c = await this.getProvider();
|
|
19108
|
-
if (!c) throw new
|
|
19108
|
+
if (!c) throw new Yo();
|
|
19109
19109
|
return Number(await c.request({ method: "eth_chainId" }));
|
|
19110
19110
|
}, getProvider: async () => (i || (i = _h({ chains: l.chains, transports: l.transports, providerAppId: e.id, apiUrl: e.apiUrl, smartWalletMode: e.smartWalletMode })), i), async isAuthorized() {
|
|
19111
19111
|
try {
|
|
@@ -19115,9 +19115,9 @@ function h0(e, t) {
|
|
|
19115
19115
|
}
|
|
19116
19116
|
}, async switchChain({ chainId: c }) {
|
|
19117
19117
|
let u = await this.getProvider();
|
|
19118
|
-
if (!u) throw new
|
|
19118
|
+
if (!u) throw new Yo();
|
|
19119
19119
|
let f = l.chains.find(((d) => d.id === c));
|
|
19120
|
-
if (!f) throw new N0(new
|
|
19120
|
+
if (!f) throw new N0(new Hp());
|
|
19121
19121
|
return c === Number(await u.request({ method: "eth_chainId" })) || (await u.request({ method: "wallet_switchEthereumChain", params: [{ chainId: `0x${c.toString(16)}` }] }), l.emitter.emit("change", { chainId: c })), f;
|
|
19122
19122
|
}, async onAccountsChanged(c) {
|
|
19123
19123
|
if (c.length !== 0) if (l.emitter.listenerCount("connect")) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@use-glyph/sdk-react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "GLYPH-1.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"path": "^0.12.7",
|
|
44
44
|
"postcss": "^8.5.6",
|
|
45
45
|
"prettier": "^3.6.2",
|
|
46
|
+
"@rainbow-me/rainbowkit": ">=2.2.8",
|
|
46
47
|
"react": ">=18",
|
|
47
48
|
"react-dom": ">=18",
|
|
48
49
|
"rimraf": "^6.0.1",
|
|
@@ -54,17 +55,17 @@
|
|
|
54
55
|
"vite-plugin-dts": "^4.5.4"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
|
-
"@privy-io/cross-app-connect": "
|
|
58
|
-
"@privy-io/react-auth": "
|
|
59
|
-
"@privy-io/wagmi": "
|
|
60
|
-
"@rainbow-me/rainbowkit": "
|
|
61
|
-
"@tanstack/react-query": "
|
|
58
|
+
"@privy-io/cross-app-connect": ">=0.2.1",
|
|
59
|
+
"@privy-io/react-auth": ">=2.21.0",
|
|
60
|
+
"@privy-io/wagmi": ">=1.0.6",
|
|
61
|
+
"@rainbow-me/rainbowkit": ">=2.2.8",
|
|
62
|
+
"@tanstack/react-query": ">=5.76.0",
|
|
62
63
|
"@types/react": ">=18",
|
|
63
64
|
"@types/react-dom": ">=18",
|
|
64
65
|
"react": ">=18",
|
|
65
66
|
"react-dom": ">=18",
|
|
66
|
-
"viem": "
|
|
67
|
-
"wagmi": "
|
|
67
|
+
"viem": ">=2.30.0",
|
|
68
|
+
"wagmi": ">=2.10.0"
|
|
68
69
|
},
|
|
69
70
|
"dependencies": {
|
|
70
71
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
@@ -84,6 +85,14 @@
|
|
|
84
85
|
"truncate-eth-address": "1.0.2",
|
|
85
86
|
"vaul": "1.1.2"
|
|
86
87
|
},
|
|
88
|
+
"peerDependenciesMeta": {
|
|
89
|
+
"@privy-io/cross-app-connect": {
|
|
90
|
+
"optional": true
|
|
91
|
+
},
|
|
92
|
+
"@rainbow-me/rainbowkit": {
|
|
93
|
+
"optional": true
|
|
94
|
+
}
|
|
95
|
+
},
|
|
87
96
|
"scripts": {
|
|
88
97
|
"watch:unix": "test -f .env && export $(cat .env | xargs) || true && vite build --watch",
|
|
89
98
|
"watch:windows": "if exist .env (set /p env=<.env && vite build --watch) else (vite build --watch)",
|