@dogeos/dogeos-sdk 4.0.3-beta.1 → 4.0.4-beta.0
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.js +93 -93
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -27398,7 +27398,7 @@ const Y4 = () => {
|
|
|
27398
27398
|
// sendTransaction: context.sendTransaction,
|
|
27399
27399
|
};
|
|
27400
27400
|
};
|
|
27401
|
-
function
|
|
27401
|
+
function sQ() {
|
|
27402
27402
|
const e = $e(tt);
|
|
27403
27403
|
if (!e)
|
|
27404
27404
|
throw new Error("useDogeOSAuth must be used within WalletConnectProvider");
|
|
@@ -27416,7 +27416,7 @@ function iQ() {
|
|
|
27416
27416
|
);
|
|
27417
27417
|
return ze(() => ({ state: r, ...n }), [n, r]);
|
|
27418
27418
|
}
|
|
27419
|
-
const
|
|
27419
|
+
const oQ = () => {
|
|
27420
27420
|
const e = $e(tt);
|
|
27421
27421
|
if (!e)
|
|
27422
27422
|
throw new Error("useConnectors must be used within WalletConnectProvider");
|
|
@@ -39987,7 +39987,7 @@ const r6 = {
|
|
|
39987
39987
|
// sendTransaction,
|
|
39988
39988
|
_setCurrentWallet: Y
|
|
39989
39989
|
};
|
|
39990
|
-
},
|
|
39990
|
+
}, aQ = () => {
|
|
39991
39991
|
const e = $e(tt);
|
|
39992
39992
|
if (!e)
|
|
39993
39993
|
throw new Error("useWalletConnect must be used within WalletConnectProvider");
|
|
@@ -41261,12 +41261,12 @@ function JX(e) {
|
|
|
41261
41261
|
});
|
|
41262
41262
|
return t.inFlight = a, a;
|
|
41263
41263
|
}
|
|
41264
|
-
const FX = "__mydogeWalletDocumentCapability", HX = 5e3;
|
|
41265
|
-
function
|
|
41264
|
+
const FX = "__mydogeWalletDocumentCapability", HX = 5e3, XX = 1e3;
|
|
41265
|
+
function KX(e) {
|
|
41266
41266
|
const t = e.detail, r = t?.info;
|
|
41267
41267
|
return typeof t?.provider?.request == "function" && typeof r?.name == "string" && typeof r?.uuid == "string" && typeof r?.icon == "string" && (r.rdns === "com.mydoge.wallet" || r.rdns === J9 || r.name === Y9 && r.uuid === F9);
|
|
41268
41268
|
}
|
|
41269
|
-
function
|
|
41269
|
+
function GX() {
|
|
41270
41270
|
const [e, t] = ot({ kind: "pending", nativeHost: !1 }), [r, n] = ot(0), i = Ct(!1), s = _e(() => n((o) => o + 1), []);
|
|
41271
41271
|
return yt(() => {
|
|
41272
41272
|
if (typeof window > "u") return;
|
|
@@ -41280,12 +41280,12 @@ function KX() {
|
|
|
41280
41280
|
const m = l();
|
|
41281
41281
|
(m || zn()) && document.readyState !== "complete" || m && (!o || typeof window.__mydogeWalletDocumentCapability != "string") || (a = !0, u(), t({ kind: m || o ? "native" : "browser" }));
|
|
41282
41282
|
}, h = (m) => {
|
|
41283
|
-
|
|
41283
|
+
KX(m) && (l() || zn()) && (JH(m.detail.provider), o = !0), d();
|
|
41284
41284
|
}, g = () => {
|
|
41285
41285
|
window.dispatchEvent(new Event("eip6963:requestProvider")), d();
|
|
41286
41286
|
};
|
|
41287
41287
|
return window.addEventListener("eip6963:announceProvider", h), window.addEventListener("load", g), c = setInterval(d, 50), f = setTimeout(() => {
|
|
41288
|
-
|
|
41288
|
+
d(), !a && (clearInterval(c), c = setInterval(d, XX), t({ kind: "unavailable", nativeHost: l() }));
|
|
41289
41289
|
}, HX), g(), () => {
|
|
41290
41290
|
a = !0, u(), window.removeEventListener("eip6963:announceProvider", h), window.removeEventListener("load", g);
|
|
41291
41291
|
};
|
|
@@ -41296,13 +41296,13 @@ function Jx(e) {
|
|
|
41296
41296
|
const t = e.basicLogins?.includes("email") ?? !1, r = (e.socialLogins?.length ?? 0) > 0;
|
|
41297
41297
|
return t || r;
|
|
41298
41298
|
}
|
|
41299
|
-
function
|
|
41299
|
+
function QX(e) {
|
|
41300
41300
|
return Jx(e) ? Ke.WalletHome : Ke.WalletList;
|
|
41301
41301
|
}
|
|
41302
|
-
function
|
|
41302
|
+
function _X(e, t) {
|
|
41303
41303
|
return t ? e?.error ? "error" : !e || e.isLoading ? "initializing" : e.wallet ? "ready" : "unavailable" : "disabled";
|
|
41304
41304
|
}
|
|
41305
|
-
function
|
|
41305
|
+
function $X(e, t) {
|
|
41306
41306
|
return t ? "connecting" : e ? "connected" : "disconnected";
|
|
41307
41307
|
}
|
|
41308
41308
|
const u6 = 15e3;
|
|
@@ -41355,7 +41355,7 @@ const d6 = (e, t) => {
|
|
|
41355
41355
|
return t;
|
|
41356
41356
|
const r = t instanceof Uint8Array ? t : t && typeof t == "object" && "data" in t && t.data instanceof Uint8Array ? t.data : null;
|
|
41357
41357
|
return r ? `0x${Array.from(r, (n) => n.toString(16).padStart(2, "0")).join("")}` : "";
|
|
41358
|
-
},
|
|
41358
|
+
}, eK = async (e, t, r = !1) => {
|
|
41359
41359
|
if (!e || !t)
|
|
41360
41360
|
return rt([]);
|
|
41361
41361
|
if (t === ye.EVM) {
|
|
@@ -41405,7 +41405,7 @@ const d6 = (e, t) => {
|
|
|
41405
41405
|
return rt([]);
|
|
41406
41406
|
}
|
|
41407
41407
|
return rt([]);
|
|
41408
|
-
},
|
|
41408
|
+
}, tK = async (e, t) => {
|
|
41409
41409
|
if (!e || !t) return rt([]);
|
|
41410
41410
|
if (t === ye.EVM) {
|
|
41411
41411
|
const r = e.request ? e : await e.getProvider?.();
|
|
@@ -41426,7 +41426,7 @@ const d6 = (e, t) => {
|
|
|
41426
41426
|
);
|
|
41427
41427
|
}
|
|
41428
41428
|
return rt([]);
|
|
41429
|
-
}, h6 = (e, t, r) => r === ye.EVM ? e.toLowerCase() === t.toLowerCase() : e === t,
|
|
41429
|
+
}, h6 = (e, t, r) => r === ye.EVM ? e.toLowerCase() === t.toLowerCase() : e === t, rK = (e) => {
|
|
41430
41430
|
const t = e.wallets.map((s) => ({
|
|
41431
41431
|
uuid: s.info.uuid,
|
|
41432
41432
|
embedded: s.isEmbeddedWallet === !0,
|
|
@@ -41466,7 +41466,7 @@ const d6 = (e, t) => {
|
|
|
41466
41466
|
sessionReadiness: i,
|
|
41467
41467
|
reconciliationRevision: e.sessionReconciliationRevision
|
|
41468
41468
|
});
|
|
41469
|
-
},
|
|
41469
|
+
}, nK = ({
|
|
41470
41470
|
walletConnectConfig: e,
|
|
41471
41471
|
setWalletState: t,
|
|
41472
41472
|
currentWallet: r,
|
|
@@ -41502,7 +41502,7 @@ const d6 = (e, t) => {
|
|
|
41502
41502
|
}
|
|
41503
41503
|
};
|
|
41504
41504
|
return yt(() => {
|
|
41505
|
-
const U =
|
|
41505
|
+
const U = rK({
|
|
41506
41506
|
storageNamespace: a,
|
|
41507
41507
|
wallets: M,
|
|
41508
41508
|
walletStatus: i,
|
|
@@ -41636,7 +41636,7 @@ const d6 = (e, t) => {
|
|
|
41636
41636
|
let Q = g.current;
|
|
41637
41637
|
if (!Q || Q.provider !== J || Q.chainType !== R) {
|
|
41638
41638
|
const te = d6(
|
|
41639
|
-
|
|
41639
|
+
tK(
|
|
41640
41640
|
J,
|
|
41641
41641
|
R
|
|
41642
41642
|
),
|
|
@@ -41690,7 +41690,7 @@ const d6 = (e, t) => {
|
|
|
41690
41690
|
currentProvider: S.provider,
|
|
41691
41691
|
providers: T
|
|
41692
41692
|
}));
|
|
41693
|
-
I || z(p.chainId), d6(
|
|
41693
|
+
I || z(p.chainId), d6(eK(S.provider, x, I), u6).then(({ addresses: V, walletStandardAccount: H, chainId: Z }) => {
|
|
41694
41694
|
const D = V.some(
|
|
41695
41695
|
(R) => h6(R, p.address, x)
|
|
41696
41696
|
);
|
|
@@ -41724,7 +41724,7 @@ const d6 = (e, t) => {
|
|
|
41724
41724
|
l
|
|
41725
41725
|
]), { isRestoreComplete: m };
|
|
41726
41726
|
};
|
|
41727
|
-
function
|
|
41727
|
+
function iK(e, t = ye.EVM) {
|
|
41728
41728
|
const r = e.connectors?.[t] ?? e.providers?.[t];
|
|
41729
41729
|
if (!r)
|
|
41730
41730
|
return null;
|
|
@@ -41748,12 +41748,12 @@ function nK(e, t = ye.EVM) {
|
|
|
41748
41748
|
emitter: o.emitter
|
|
41749
41749
|
}));
|
|
41750
41750
|
}
|
|
41751
|
-
function
|
|
41751
|
+
function sK(e, t = ye.EVM, r) {
|
|
41752
41752
|
const n = [];
|
|
41753
41753
|
if (r.length === 0)
|
|
41754
41754
|
return n;
|
|
41755
41755
|
for (const i of e) {
|
|
41756
|
-
const s =
|
|
41756
|
+
const s = iK(i, t);
|
|
41757
41757
|
if (s) {
|
|
41758
41758
|
const o = OE(zE());
|
|
41759
41759
|
n.push(
|
|
@@ -41766,7 +41766,7 @@ function iK(e, t = ye.EVM, r) {
|
|
|
41766
41766
|
}
|
|
41767
41767
|
return n;
|
|
41768
41768
|
}
|
|
41769
|
-
function
|
|
41769
|
+
function oK(e, t = []) {
|
|
41770
41770
|
const r = [...t], n = (s) => "id" in s && s.id ? s.id : "options" in s && s.options ? (() => {
|
|
41771
41771
|
const o = s.options;
|
|
41772
41772
|
return o?.id ?? o?.name;
|
|
@@ -41775,15 +41775,15 @@ function sK(e, t = []) {
|
|
|
41775
41775
|
i.has(n(s)) || r.push(s);
|
|
41776
41776
|
return r;
|
|
41777
41777
|
}
|
|
41778
|
-
function
|
|
41778
|
+
function aK(e) {
|
|
41779
41779
|
yt(() => {
|
|
41780
41780
|
T1(e);
|
|
41781
41781
|
}, [e]);
|
|
41782
41782
|
}
|
|
41783
|
-
function
|
|
41783
|
+
function cK(e) {
|
|
41784
41784
|
return e.snapshot.kind !== "anonymous" || e.sessionReconciliation?.kind === "anonymous";
|
|
41785
41785
|
}
|
|
41786
|
-
function
|
|
41786
|
+
function lK(e) {
|
|
41787
41787
|
return e.walletReinitializationRequired || e.walletOperationActive ? null : e.pendingWalletCompletion ? U4(
|
|
41788
41788
|
e.pendingWalletCompletion,
|
|
41789
41789
|
e.snapshot
|
|
@@ -41792,7 +41792,7 @@ function cK(e) {
|
|
|
41792
41792
|
e.snapshot.session
|
|
41793
41793
|
)) ? "established_custody" : null;
|
|
41794
41794
|
}
|
|
41795
|
-
function
|
|
41795
|
+
function fK(e) {
|
|
41796
41796
|
if (e.pendingWalletCompletion.current = null, e.establishedWalletAccount.current = null, e.resetWalletState(), !e.embeddedWallet) return Promise.resolve();
|
|
41797
41797
|
const t = e.embeddedWallet;
|
|
41798
41798
|
return e.walletReinitializationRequired.current = !0, wg(e.walletOperationQueue, async () => {
|
|
@@ -41807,7 +41807,7 @@ function lK(e) {
|
|
|
41807
41807
|
});
|
|
41808
41808
|
}
|
|
41809
41809
|
const E0 = [1e3, 3e3];
|
|
41810
|
-
function
|
|
41810
|
+
function uK(e, t) {
|
|
41811
41811
|
const r = t?.onAuthoritativeAnonymous, n = t?.reconciliationRequested === !0, i = t?.shouldReconcileAnonymousSnapshot, [s, o] = ot({ value: null, revision: 0 }), a = Ct(null), c = _e(
|
|
41812
41812
|
(u) => {
|
|
41813
41813
|
o((d) => ({
|
|
@@ -41886,11 +41886,11 @@ function fK(e, t) {
|
|
|
41886
41886
|
invalidateSessionReconciliation: l
|
|
41887
41887
|
};
|
|
41888
41888
|
}
|
|
41889
|
-
const kg = 1,
|
|
41889
|
+
const kg = 1, dK = "dogeos-authenticated-wallet-retry:", Xx = 1, hK = "dogeos-authenticated-session-hint:", p6 = { kind: "none" }, S0 = "Checking your DogeOS session before reconnecting…";
|
|
41890
41890
|
function Kx(e) {
|
|
41891
41891
|
return e === "temporarily_unavailable" || e === "rate_limited";
|
|
41892
41892
|
}
|
|
41893
|
-
function
|
|
41893
|
+
function pK(e) {
|
|
41894
41894
|
if (e === null) return null;
|
|
41895
41895
|
try {
|
|
41896
41896
|
const t = JSON.parse(e);
|
|
@@ -41908,7 +41908,7 @@ function hK(e) {
|
|
|
41908
41908
|
return null;
|
|
41909
41909
|
}
|
|
41910
41910
|
}
|
|
41911
|
-
function
|
|
41911
|
+
function gK(e) {
|
|
41912
41912
|
if (e === null) return !1;
|
|
41913
41913
|
try {
|
|
41914
41914
|
const t = JSON.parse(e);
|
|
@@ -41923,11 +41923,11 @@ function pK(e) {
|
|
|
41923
41923
|
return !1;
|
|
41924
41924
|
}
|
|
41925
41925
|
}
|
|
41926
|
-
function
|
|
41926
|
+
function mK(e) {
|
|
41927
41927
|
const t = /* @__PURE__ */ new Set();
|
|
41928
41928
|
let r = null;
|
|
41929
41929
|
try {
|
|
41930
|
-
r =
|
|
41930
|
+
r = pK(e.storage?.getItem(e.storageKey) ?? null);
|
|
41931
41931
|
} catch {
|
|
41932
41932
|
r = null;
|
|
41933
41933
|
}
|
|
@@ -41964,12 +41964,12 @@ function gK(e) {
|
|
|
41964
41964
|
}
|
|
41965
41965
|
};
|
|
41966
41966
|
}
|
|
41967
|
-
function
|
|
41967
|
+
function vK(e) {
|
|
41968
41968
|
const t = /* @__PURE__ */ new Set();
|
|
41969
41969
|
let r = !1;
|
|
41970
41970
|
try {
|
|
41971
41971
|
const i = e.storage?.getItem(e.storageKey) ?? null;
|
|
41972
|
-
r =
|
|
41972
|
+
r = gK(i), i !== null && !r && e.storage?.removeItem(e.storageKey);
|
|
41973
41973
|
} catch {
|
|
41974
41974
|
r = !1;
|
|
41975
41975
|
}
|
|
@@ -42009,7 +42009,7 @@ function mK(e) {
|
|
|
42009
42009
|
};
|
|
42010
42010
|
}
|
|
42011
42011
|
const g6 = /* @__PURE__ */ new Map(), m6 = /* @__PURE__ */ new Map();
|
|
42012
|
-
function
|
|
42012
|
+
function yK() {
|
|
42013
42013
|
if (typeof window > "u") return null;
|
|
42014
42014
|
try {
|
|
42015
42015
|
return window.sessionStorage;
|
|
@@ -42017,7 +42017,7 @@ function vK() {
|
|
|
42017
42017
|
return null;
|
|
42018
42018
|
}
|
|
42019
42019
|
}
|
|
42020
|
-
function
|
|
42020
|
+
function bK() {
|
|
42021
42021
|
if (typeof window > "u") return null;
|
|
42022
42022
|
try {
|
|
42023
42023
|
return window.localStorage;
|
|
@@ -42025,33 +42025,33 @@ function yK() {
|
|
|
42025
42025
|
return null;
|
|
42026
42026
|
}
|
|
42027
42027
|
}
|
|
42028
|
-
function
|
|
42028
|
+
function wK(e) {
|
|
42029
42029
|
const t = typeof window > "u" ? "server" : window.location.origin, r = JSON.stringify([t, e]), n = g6.get(r);
|
|
42030
42030
|
if (n) return n;
|
|
42031
|
-
const i =
|
|
42032
|
-
storage:
|
|
42033
|
-
storageKey: `${
|
|
42031
|
+
const i = mK({
|
|
42032
|
+
storage: yK(),
|
|
42033
|
+
storageKey: `${dK}${encodeURIComponent(
|
|
42034
42034
|
r
|
|
42035
42035
|
)}`
|
|
42036
42036
|
});
|
|
42037
42037
|
return g6.set(r, i), i;
|
|
42038
42038
|
}
|
|
42039
|
-
function
|
|
42039
|
+
function AK(e) {
|
|
42040
42040
|
const t = typeof window > "u" ? "server" : window.location.origin, r = JSON.stringify([t, e]), n = m6.get(r);
|
|
42041
42041
|
if (n) return n;
|
|
42042
|
-
const i =
|
|
42043
|
-
storage:
|
|
42044
|
-
storageKey: `${
|
|
42042
|
+
const i = vK({
|
|
42043
|
+
storage: bK(),
|
|
42044
|
+
storageKey: `${hK}${encodeURIComponent(
|
|
42045
42045
|
r
|
|
42046
42046
|
)}`
|
|
42047
42047
|
});
|
|
42048
42048
|
return m6.set(r, i), i;
|
|
42049
42049
|
}
|
|
42050
|
-
function
|
|
42050
|
+
function xK(e) {
|
|
42051
42051
|
const t = Ct(null);
|
|
42052
42052
|
return t.current === null && (t.current = e.getSnapshot()), t.current;
|
|
42053
42053
|
}
|
|
42054
|
-
function
|
|
42054
|
+
function EK(e) {
|
|
42055
42055
|
if (!e.marker)
|
|
42056
42056
|
return e.sessionHintActive === !0 && (e.sessionReconciliation === null || e.sessionReconciliation.kind === "unavailable") ? {
|
|
42057
42057
|
kind: "reconciling",
|
|
@@ -42069,7 +42069,7 @@ function xK(e) {
|
|
|
42069
42069
|
message: S0
|
|
42070
42070
|
};
|
|
42071
42071
|
}
|
|
42072
|
-
function
|
|
42072
|
+
function SK(e) {
|
|
42073
42073
|
const t = fl(
|
|
42074
42074
|
e.store.subscribe,
|
|
42075
42075
|
e.store.getSnapshot,
|
|
@@ -42080,13 +42080,13 @@ function EK(e) {
|
|
|
42080
42080
|
e.sessionHintStore?.getSnapshot ?? (() => !1),
|
|
42081
42081
|
() => !1
|
|
42082
42082
|
);
|
|
42083
|
-
return
|
|
42083
|
+
return EK({
|
|
42084
42084
|
marker: t,
|
|
42085
42085
|
sessionHintActive: r,
|
|
42086
42086
|
sessionReconciliation: e.sessionReconciliation
|
|
42087
42087
|
});
|
|
42088
42088
|
}
|
|
42089
|
-
const
|
|
42089
|
+
const IK = ({
|
|
42090
42090
|
children: e,
|
|
42091
42091
|
contextConfig: t,
|
|
42092
42092
|
authClient: r,
|
|
@@ -42094,9 +42094,9 @@ const SK = ({
|
|
|
42094
42094
|
defaultMainView: i,
|
|
42095
42095
|
embeddedWalletEnabled: s
|
|
42096
42096
|
}) => {
|
|
42097
|
-
const o = Ct(null), a = Ct(tJ()).current, [c] = ot(rJ), f = Ct(fJ()), l = Ct(gJ()), u = Ct(null), d = Ct(!1), h = Ct(null), g =
|
|
42097
|
+
const o = Ct(null), a = Ct(tJ()).current, [c] = ot(rJ), f = Ct(fJ()), l = Ct(gJ()), u = Ct(null), d = Ct(!1), h = Ct(null), g = wK(t.clientId), m = AK(
|
|
42098
42098
|
t.clientId
|
|
42099
|
-
), A =
|
|
42099
|
+
), A = xK(
|
|
42100
42100
|
m
|
|
42101
42101
|
), b = _e(() => {
|
|
42102
42102
|
g.clear(), m.clear();
|
|
@@ -42107,7 +42107,7 @@ const SK = ({
|
|
|
42107
42107
|
sessionReconciliation: B,
|
|
42108
42108
|
reconciliationRevision: M,
|
|
42109
42109
|
invalidateSessionReconciliation: k
|
|
42110
|
-
} =
|
|
42110
|
+
} = uK(r, {
|
|
42111
42111
|
onAuthoritativeAnonymous: b,
|
|
42112
42112
|
reconciliationRequested: A,
|
|
42113
42113
|
shouldReconcileAnonymousSnapshot: m.getSnapshot
|
|
@@ -42116,7 +42116,7 @@ const SK = ({
|
|
|
42116
42116
|
}, [
|
|
42117
42117
|
b,
|
|
42118
42118
|
k
|
|
42119
|
-
]), q =
|
|
42119
|
+
]), q = SK({
|
|
42120
42120
|
store: g,
|
|
42121
42121
|
sessionHintStore: m,
|
|
42122
42122
|
sessionReconciliation: B
|
|
@@ -42172,7 +42172,7 @@ const SK = ({
|
|
|
42172
42172
|
U,
|
|
42173
42173
|
W.isConnected
|
|
42174
42174
|
]
|
|
42175
|
-
), H =
|
|
42175
|
+
), H = $X(W.isConnected, W.isConnecting), Z = ze(
|
|
42176
42176
|
() => ({
|
|
42177
42177
|
connectionStatus: H,
|
|
42178
42178
|
isConnected: W.isConnected,
|
|
@@ -42211,7 +42211,7 @@ const SK = ({
|
|
|
42211
42211
|
}),
|
|
42212
42212
|
[p, v, w, S, C, P, x]
|
|
42213
42213
|
), J = ze(
|
|
42214
|
-
() =>
|
|
42214
|
+
() => _X(R, s),
|
|
42215
42215
|
[R, s]
|
|
42216
42216
|
), X = ze(
|
|
42217
42217
|
() => ({
|
|
@@ -42267,17 +42267,17 @@ const SK = ({
|
|
|
42267
42267
|
yt(() => {
|
|
42268
42268
|
const oe = () => {
|
|
42269
42269
|
const me = o.current, ee = r.getSnapshot();
|
|
42270
|
-
!
|
|
42270
|
+
!cK({
|
|
42271
42271
|
snapshot: ee,
|
|
42272
42272
|
sessionReconciliation: B
|
|
42273
|
-
}) || !
|
|
42273
|
+
}) || !lK({
|
|
42274
42274
|
pendingWalletCompletion: me,
|
|
42275
42275
|
establishedWalletAccount: u.current,
|
|
42276
42276
|
snapshot: ee,
|
|
42277
42277
|
embeddedCustodyConnected: W.isConnected && W.currentWallet?.isEmbeddedWallet === !0,
|
|
42278
42278
|
walletOperationActive: a.active > 0,
|
|
42279
42279
|
walletReinitializationRequired: d.current
|
|
42280
|
-
}) ||
|
|
42280
|
+
}) || fK({
|
|
42281
42281
|
pendingWalletCompletion: o,
|
|
42282
42282
|
establishedWalletAccount: u,
|
|
42283
42283
|
walletReinitializationRequired: d,
|
|
@@ -42307,7 +42307,7 @@ const SK = ({
|
|
|
42307
42307
|
W.currentWallet?.isEmbeddedWallet,
|
|
42308
42308
|
W.isConnected,
|
|
42309
42309
|
a
|
|
42310
|
-
]),
|
|
42310
|
+
]), aK(t.walletConnectConfig);
|
|
42311
42311
|
const j = _a("all", t?.connectors || [], {
|
|
42312
42312
|
embeddedWallet: p,
|
|
42313
42313
|
walletConnectConfig: t.walletConnectConfig
|
|
@@ -42317,10 +42317,10 @@ const SK = ({
|
|
|
42317
42317
|
y0(null);
|
|
42318
42318
|
return;
|
|
42319
42319
|
}
|
|
42320
|
-
const oe = te.connectors ? [...te.connectors] : [], de = te.chains ? [...te.chains] : [], me = j?.data?.all?.filter((_) => _.connectors[ye.EVM]), ee =
|
|
42320
|
+
const oe = te.connectors ? [...te.connectors] : [], de = te.chains ? [...te.chains] : [], me = j?.data?.all?.filter((_) => _.connectors[ye.EVM]), ee = sK(me || [], ye.EVM, de), Ee = oK(ee, oe);
|
|
42321
42321
|
Ee.length > 0 ? y0(Ee) : y0(null);
|
|
42322
42322
|
}, [j.data, te]);
|
|
42323
|
-
const { isRestoreComplete: se } =
|
|
42323
|
+
const { isRestoreComplete: se } = nK({
|
|
42324
42324
|
walletConnectConfig: t.walletConnectConfig,
|
|
42325
42325
|
setWalletState: G,
|
|
42326
42326
|
currentWallet: D.currentWallet,
|
|
@@ -42353,7 +42353,7 @@ const SK = ({
|
|
|
42353
42353
|
};
|
|
42354
42354
|
}
|
|
42355
42355
|
}, [W.isConnected, W.chainType, W.currentProvider, G]), /* @__PURE__ */ F(hf.Provider, { value: R, children: /* @__PURE__ */ F(tt.Provider, { value: L, children: /* @__PURE__ */ F(
|
|
42356
|
-
|
|
42356
|
+
CK,
|
|
42357
42357
|
{
|
|
42358
42358
|
contextConfig: t,
|
|
42359
42359
|
wallets: j.data?.all || [],
|
|
@@ -42371,7 +42371,7 @@ const SK = ({
|
|
|
42371
42371
|
}
|
|
42372
42372
|
) }) });
|
|
42373
42373
|
};
|
|
42374
|
-
function
|
|
42374
|
+
function CK({
|
|
42375
42375
|
children: e,
|
|
42376
42376
|
contextConfig: t,
|
|
42377
42377
|
wallets: r,
|
|
@@ -42489,7 +42489,7 @@ function IK({
|
|
|
42489
42489
|
o
|
|
42490
42490
|
]);
|
|
42491
42491
|
return /* @__PURE__ */ ue(tt.Provider, { value: B, children: [
|
|
42492
|
-
/* @__PURE__ */ F(
|
|
42492
|
+
/* @__PURE__ */ F(MK, { isRestoreComplete: u }),
|
|
42493
42493
|
/* @__PURE__ */ ue(
|
|
42494
42494
|
Tj,
|
|
42495
42495
|
{
|
|
@@ -42515,7 +42515,7 @@ function IK({
|
|
|
42515
42515
|
)
|
|
42516
42516
|
] });
|
|
42517
42517
|
}
|
|
42518
|
-
function
|
|
42518
|
+
function MK({
|
|
42519
42519
|
isRestoreComplete: e
|
|
42520
42520
|
}) {
|
|
42521
42521
|
const t = $e(tt), r = Ct(!1), [n, i] = ot(0), {
|
|
@@ -42545,7 +42545,7 @@ function CK({
|
|
|
42545
42545
|
s
|
|
42546
42546
|
]), null;
|
|
42547
42547
|
}
|
|
42548
|
-
function
|
|
42548
|
+
function PK(e) {
|
|
42549
42549
|
const t = aa.login, r = e.login?.socialLogins ?? t?.socialLogins ?? [];
|
|
42550
42550
|
return {
|
|
42551
42551
|
basicLogins: e.login?.basicLogins ?? [...t?.basicLogins ?? []],
|
|
@@ -42564,7 +42564,7 @@ function ll(e, t) {
|
|
|
42564
42564
|
throw new Error(`${t} is required.`);
|
|
42565
42565
|
return e;
|
|
42566
42566
|
}
|
|
42567
|
-
function
|
|
42567
|
+
function BK(e) {
|
|
42568
42568
|
const t = "DogeOS Social Wallet", r = `${er.web3AssetsBaseUrl}/assets/wallets/mydoge/wallet.svg`;
|
|
42569
42569
|
return {
|
|
42570
42570
|
clientId: ll(e.clientId, "config.clientId"),
|
|
@@ -42575,23 +42575,23 @@ function PK(e) {
|
|
|
42575
42575
|
stage: e.embeddedWalletConfig?.stage ?? er.embeddedWalletStage
|
|
42576
42576
|
};
|
|
42577
42577
|
}
|
|
42578
|
-
function
|
|
42578
|
+
function TK(e, t, r) {
|
|
42579
42579
|
const n = e?.trim();
|
|
42580
42580
|
return n ? { projectId: n, metadata: t, evmChains: r } : null;
|
|
42581
42581
|
}
|
|
42582
|
-
const
|
|
42582
|
+
const kK = new SE({
|
|
42583
42583
|
defaultOptions: {
|
|
42584
42584
|
queries: {
|
|
42585
42585
|
refetchOnWindowFocus: !1
|
|
42586
42586
|
}
|
|
42587
42587
|
}
|
|
42588
42588
|
});
|
|
42589
|
-
function
|
|
42589
|
+
function OK(e) {
|
|
42590
42590
|
for (const t of ["services", "authClient"])
|
|
42591
42591
|
if (Object.prototype.hasOwnProperty.call(e, t))
|
|
42592
42592
|
throw new Error(`config.${t} is SDK-owned and cannot be overridden by consumers.`);
|
|
42593
42593
|
}
|
|
42594
|
-
function
|
|
42594
|
+
function zK(e) {
|
|
42595
42595
|
const t = typeof e == "object" && e !== null ? e.id : e;
|
|
42596
42596
|
if (typeof t == "number")
|
|
42597
42597
|
return `eip155:${t}`;
|
|
@@ -42603,12 +42603,12 @@ function OK(e) {
|
|
|
42603
42603
|
const n = r.startsWith("0x") ? parseInt(r, 16) : Number(r);
|
|
42604
42604
|
return Number.isFinite(n) ? `eip155:${n}` : null;
|
|
42605
42605
|
}
|
|
42606
|
-
function
|
|
42607
|
-
return [...new Set((e?.evm || []).map(
|
|
42606
|
+
function DK(e) {
|
|
42607
|
+
return [...new Set((e?.evm || []).map(zK).filter(Boolean))];
|
|
42608
42608
|
}
|
|
42609
|
-
const
|
|
42610
|
-
const r =
|
|
42611
|
-
|
|
42609
|
+
const cQ = ({ children: e, config: t }) => {
|
|
42610
|
+
const r = GX(), n = zx();
|
|
42611
|
+
OK(t);
|
|
42612
42612
|
const i = ze(
|
|
42613
42613
|
() => YX({
|
|
42614
42614
|
clientId: ll(t.clientId, "config.clientId"),
|
|
@@ -42616,17 +42616,17 @@ const aQ = ({ children: e, config: t }) => {
|
|
|
42616
42616
|
}),
|
|
42617
42617
|
[t.clientId, t.gatewayBaseUrl]
|
|
42618
42618
|
), s = ze(() => {
|
|
42619
|
-
const l = ll(t, "config"), u = r.kind === "native" ? { basicLogins: ["externalWallets"], socialLogins: [] } :
|
|
42619
|
+
const l = ll(t, "config"), u = r.kind === "native" ? { basicLogins: ["externalWallets"], socialLogins: [] } : PK(l), d = l.chains, h = d && Object.keys(d).length > 0 ? d : aa.chains, g = ll(
|
|
42620
42620
|
aa.metadata,
|
|
42621
42621
|
"SDK default metadata"
|
|
42622
42622
|
), m = {
|
|
42623
42623
|
...g,
|
|
42624
42624
|
...l.metadata,
|
|
42625
42625
|
icons: l.metadata?.icons?.length ? [...l.metadata.icons] : [...g.icons]
|
|
42626
|
-
}, A =
|
|
42626
|
+
}, A = TK(
|
|
42627
42627
|
l.walletConnectProjectId,
|
|
42628
42628
|
m,
|
|
42629
|
-
|
|
42629
|
+
DK(h)
|
|
42630
42630
|
), b = l.theme && l.theme.themes ? { ...l.theme, prefix: "heroui" } : { ...aa.theme, prefix: "heroui" }, B = {
|
|
42631
42631
|
...t,
|
|
42632
42632
|
connectors: l.connectors || aa.connectors,
|
|
@@ -42634,14 +42634,14 @@ const aQ = ({ children: e, config: t }) => {
|
|
|
42634
42634
|
login: u,
|
|
42635
42635
|
theme: b,
|
|
42636
42636
|
walletConnectConfig: A,
|
|
42637
|
-
embeddedWalletConfig:
|
|
42637
|
+
embeddedWalletConfig: BK(l),
|
|
42638
42638
|
metadata: m,
|
|
42639
42639
|
links: Hj,
|
|
42640
42640
|
themeMode: l.theme?.defaultTheme || "light",
|
|
42641
42641
|
wagmi: n ? { config: n } : void 0
|
|
42642
42642
|
};
|
|
42643
42643
|
return t6(n || null), B;
|
|
42644
|
-
}, [t, n, r.kind]), o = s.login, a = ze(() =>
|
|
42644
|
+
}, [t, n, r.kind]), o = s.login, a = ze(() => QX(o), [o]), c = ze(
|
|
42645
42645
|
() => Jx(o),
|
|
42646
42646
|
[o]
|
|
42647
42647
|
), f = ze(() => {
|
|
@@ -42670,8 +42670,8 @@ const aQ = ({ children: e, config: t }) => {
|
|
|
42670
42670
|
return typeof window > "u" ? null : r.kind === "pending" ? /* @__PURE__ */ F("div", { role: "status", children: "Preparing wallet connection…" }) : r.kind === "unavailable" ? /* @__PURE__ */ ue("div", { role: "alert", children: [
|
|
42671
42671
|
/* @__PURE__ */ F("p", { children: r.nativeHost ? "MyDoge is not ready to connect. Retry, or close and reopen this dApp." : "Wallet connection is not ready. Retry after the page finishes loading." }),
|
|
42672
42672
|
/* @__PURE__ */ F("button", { type: "button", onClick: r.retry, children: "Retry" })
|
|
42673
|
-
] }) : /* @__PURE__ */ F(EE, { client:
|
|
42674
|
-
|
|
42673
|
+
] }) : /* @__PURE__ */ F(EE, { client: kK, children: /* @__PURE__ */ F(
|
|
42674
|
+
IK,
|
|
42675
42675
|
{
|
|
42676
42676
|
contextConfig: s,
|
|
42677
42677
|
authClient: i,
|
|
@@ -42681,7 +42681,7 @@ const aQ = ({ children: e, config: t }) => {
|
|
|
42681
42681
|
children: e
|
|
42682
42682
|
}
|
|
42683
42683
|
) });
|
|
42684
|
-
},
|
|
42684
|
+
}, lQ = ({ className: e, style: t }) => {
|
|
42685
42685
|
const r = $e(tt);
|
|
42686
42686
|
if (!r)
|
|
42687
42687
|
return console.error("WalletConnectEmbed must be used within WalletConnectProvider"), null;
|
|
@@ -42698,7 +42698,7 @@ const aQ = ({ children: e, config: t }) => {
|
|
|
42698
42698
|
}
|
|
42699
42699
|
);
|
|
42700
42700
|
};
|
|
42701
|
-
async function
|
|
42701
|
+
async function fQ() {
|
|
42702
42702
|
const e = await j6({
|
|
42703
42703
|
web3AssetsBaseUrl: er.web3AssetsBaseUrl
|
|
42704
42704
|
});
|
|
@@ -42762,7 +42762,7 @@ async function lQ() {
|
|
|
42762
42762
|
}
|
|
42763
42763
|
return r;
|
|
42764
42764
|
}
|
|
42765
|
-
async function
|
|
42765
|
+
async function uQ() {
|
|
42766
42766
|
const e = I0.get(
|
|
42767
42767
|
er.web3AssetsBaseUrl
|
|
42768
42768
|
);
|
|
@@ -42792,13 +42792,13 @@ async function fQ() {
|
|
|
42792
42792
|
const I0 = /* @__PURE__ */ new Map();
|
|
42793
42793
|
export {
|
|
42794
42794
|
ye as ChainTypeEnum,
|
|
42795
|
-
|
|
42796
|
-
|
|
42797
|
-
|
|
42798
|
-
|
|
42795
|
+
lQ as WalletConnectEmbed,
|
|
42796
|
+
cQ as WalletConnectProvider,
|
|
42797
|
+
fQ as getChains,
|
|
42798
|
+
uQ as getConnectors,
|
|
42799
42799
|
em as useAccount,
|
|
42800
|
-
|
|
42801
|
-
|
|
42800
|
+
oQ as useConnectors,
|
|
42801
|
+
sQ as useDogeOSAuth,
|
|
42802
42802
|
wJ as useEmbeddedWallet,
|
|
42803
|
-
|
|
42803
|
+
aQ as useWalletConnect
|
|
42804
42804
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dogeos/dogeos-sdk",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.4-beta.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -87,11 +87,11 @@
|
|
|
87
87
|
"vitest": "^4.0.18",
|
|
88
88
|
"wagmi": "^2.0.0",
|
|
89
89
|
"@dogeos/dogeos-ui": "0.0.14",
|
|
90
|
-
"@dogeos/embedded-wallet-providers": "0.0.28",
|
|
91
90
|
"@dogeos/inject-providers": "0.0.21",
|
|
91
|
+
"@dogeos/embedded-wallet-providers": "0.0.28",
|
|
92
92
|
"@dogeos/oidc-auth": "0.0.20",
|
|
93
|
-
"@dogeos/wallet-
|
|
94
|
-
"@dogeos/wallet-
|
|
93
|
+
"@dogeos/wallet-utils": "0.0.23",
|
|
94
|
+
"@dogeos/wallet-adaptor-base": "0.0.25"
|
|
95
95
|
},
|
|
96
96
|
"sideEffects": [
|
|
97
97
|
"**/*.css",
|