@etherplay/dev-wallet-host 0.2.0 → 0.3.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/package.json +1 -1
- package/site/assets/{App-xSBx5ak5.js → App-jiH5KsZN.js} +21 -30
- package/site/assets/App-jiH5KsZN.js.map +1 -0
- package/site/assets/{bignumbers-C7-lnukQ.js → bignumbers-CDwemtjh.js} +2 -2
- package/site/assets/{bignumbers-C7-lnukQ.js.map → bignumbers-CDwemtjh.js.map} +1 -1
- package/site/assets/{index-BSfEJRCZ.js → index--WaQfBnk.js} +3 -3
- package/site/assets/{index-BSfEJRCZ.js.map → index--WaQfBnk.js.map} +1 -1
- package/site/assets/{index-CkvCbn7v.js → index-B0bHIDP-.js} +2 -2
- package/site/assets/{index-CkvCbn7v.js.map → index-B0bHIDP-.js.map} +1 -1
- package/site/assets/{index-IIDV-e6n.js → index-BQfjfSli.js} +6 -6
- package/site/assets/{index-IIDV-e6n.js.map → index-BQfjfSli.js.map} +1 -1
- package/site/assets/{index-B_E-HnzD.js → index-CNWQNI4F.js} +8 -8
- package/site/assets/{index-B_E-HnzD.js.map → index-CNWQNI4F.js.map} +1 -1
- package/site/assets/{index-Bz0M5Gj5.js → index-CY5VRUKw.js} +4 -4
- package/site/assets/{index-Bz0M5Gj5.js.map → index-CY5VRUKw.js.map} +1 -1
- package/site/assets/{index-LN4UBwKA.js → index-LuGvuWDj.js} +6 -6
- package/site/assets/{index-LN4UBwKA.js.map → index-LuGvuWDj.js.map} +1 -1
- package/site/assets/{login-CT3CiPqL.js → login-Djc2e6Ld.js} +3 -3
- package/site/assets/{login-CT3CiPqL.js.map → login-Djc2e6Ld.js.map} +1 -1
- package/site/assets/{typed-data-kK2YTiXf.js → typed-data-B1d1daZe.js} +4 -4
- package/site/assets/{typed-data-kK2YTiXf.js.map → typed-data-B1d1daZe.js.map} +1 -1
- package/site/assets/{utf8-DUBJCSEI.js → utf8-CL2y2HZA.js} +2 -2
- package/site/assets/{utf8-DUBJCSEI.js.map → utf8-CL2y2HZA.js.map} +1 -1
- package/site/login/index.html +1 -1
- package/site/assets/App-xSBx5ak5.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etherplay/dev-wallet-host",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "The Etherplay sign-in host, prebuilt, for DEVELOPMENT and e2e only - run it next to your app the way you run a faucet. Unfit for real accounts by construction.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"etherplay",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index--WaQfBnk.js","assets/index-client-8kPxwRn_.js","assets/login-Djc2e6Ld.js","assets/login-Dm0rG43D.css","assets/index-BQfjfSli.js","assets/typed-data-B1d1daZe.js","assets/utf8-CL2y2HZA.js","assets/index-B0bHIDP-.js","assets/index-LuGvuWDj.js","assets/bignumbers-CDwemtjh.js","assets/index-CNWQNI4F.js","assets/index-CY5VRUKw.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __typeError = (msg) => {
|
|
4
4
|
throw TypeError(msg);
|
|
@@ -20,7 +20,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
20
20
|
});
|
|
21
21
|
var _a, _b, _c, _d, _e, _t, _e2, _s, _a2, _i, _r, _o, _n, _h, _d2, _c2, _p, _E_instances, m_fn, _f, _e3, _s2, _t2, _i2, _o2, _r2, _n2, _a3, _c3, _g2, _h2, _d3, _l, _g, _h3;
|
|
22
22
|
import { i as is_array, g as get_prototype_of, o as object_prototype, c as create_text, a as active_effect, b as get_first_child, d as is_firefox, T as TEMPLATE_FRAGMENT, e as TEMPLATE_USE_IMPORT_NODE, f as block, E as EFFECT_TRANSPARENT, r as resume_effect, h as branch, p as pause_effect, U as UNINITIALIZED, j as get$2, k as derived_safe_equal, I as INERT, l as array_from, m as mutable_source, s as source$1, n as internal_set, q as pause_children, t as clear_text_content, u as run_out_transitions, v as destroy_effect, w as EACH_INDEX_REACTIVE, x as EACH_ITEM_REACTIVE, y as EACH_ITEM_IMMUTABLE, z as get_next_sibling, A as EACH_IS_CONTROLLED, B as queue_micro_task, C as EACH_IS_ANIMATED, D as effect, F as untrack, G as render_effect, H as deep_read_state, J as safe_not_equal$1, L as LOADING_ATTR_SYMBOL, N as NAMESPACE_HTML, K as get_descriptors, S as STATE_SYMBOL, M as component_context, O as user_pre_effect, P as user_effect, Q as run_all, R as run, V as derived, W as noop$3, X as teardown, Y as define_property, Z as set, _ as proxy, $ as get_descriptor, a0 as props_invalid_value, a1 as LEGACY_DERIVED_PROP, a2 as PROPS_IS_UPDATED, a3 as safe_equals, a4 as PROPS_IS_BINDABLE, a5 as LEGACY_PROPS, a6 as PROPS_IS_LAZY_INITIAL, a7 as legacy_mode_flag, a8 as PROPS_IS_RUNES, a9 as PROPS_IS_IMMUTABLE, aa as enable_legacy_mode_flag, ab as delegate, ac as push, ad as user_derived, ae as sibling, af as pop, ag as child, ah as template_effect, ai as set_text, aj as first_child, ak as onMount, al as event, am as state } from "./index-client-8kPxwRn_.js";
|
|
23
|
-
import { _ as __vitePreload, h as hostConfig } from "./login-
|
|
23
|
+
import { _ as __vitePreload, h as hostConfig } from "./login-Djc2e6Ld.js";
|
|
24
24
|
const empty = [];
|
|
25
25
|
function snapshot(value, skip_warning = false) {
|
|
26
26
|
return clone(value, /* @__PURE__ */ new Map(), "", empty);
|
|
@@ -1535,11 +1535,9 @@ function OTP($$anchor, $$props) {
|
|
|
1535
1535
|
let otpInputs = [];
|
|
1536
1536
|
function onPaste(event2) {
|
|
1537
1537
|
var _a4;
|
|
1538
|
-
console.log(event2);
|
|
1539
1538
|
event2.preventDefault();
|
|
1540
1539
|
const text2 = (_a4 = event2.clipboardData) == null ? void 0 : _a4.getData("text");
|
|
1541
1540
|
const numerals = text2.replace(/\D/g, "");
|
|
1542
|
-
console.log({ numerals });
|
|
1543
1541
|
const currentIndex = Number(event2.target.dataset.index);
|
|
1544
1542
|
$$props.onAcknowledge();
|
|
1545
1543
|
let startIndex = otpInputs.findIndex((input, index2) => index2 < currentIndex && !input.value);
|
|
@@ -1581,7 +1579,6 @@ function OTP($$anchor, $$props) {
|
|
|
1581
1579
|
}
|
|
1582
1580
|
function onChange(event2) {
|
|
1583
1581
|
const val = event2.target.value;
|
|
1584
|
-
console.log({ val });
|
|
1585
1582
|
if (!val) {
|
|
1586
1583
|
event2.preventDefault();
|
|
1587
1584
|
return;
|
|
@@ -1600,7 +1597,6 @@ function OTP($$anchor, $$props) {
|
|
|
1600
1597
|
if (value) {
|
|
1601
1598
|
$$props.onAcknowledge();
|
|
1602
1599
|
}
|
|
1603
|
-
console.log({ target, value });
|
|
1604
1600
|
toggleFilledClass(target);
|
|
1605
1601
|
if (target.nextElementSibling) {
|
|
1606
1602
|
if ("focus" in target.nextElementSibling && target.nextElementSibling.focus) {
|
|
@@ -1651,7 +1647,6 @@ function Email($$anchor, $$props) {
|
|
|
1651
1647
|
let otp = state(void 0);
|
|
1652
1648
|
async function _submitOTP(text2) {
|
|
1653
1649
|
var _a4;
|
|
1654
|
-
console.log({ otpCode: text2 });
|
|
1655
1650
|
try {
|
|
1656
1651
|
await $$props.authProvider.provideOTP(text2);
|
|
1657
1652
|
} catch (error) {
|
|
@@ -9438,6 +9433,12 @@ function fromSignatureToKey(signature) {
|
|
|
9438
9433
|
const hash = keccak_256$1(hexToBytes$2(signature.slice(2)));
|
|
9439
9434
|
return `0x${bytesToHex$2(hash)}`;
|
|
9440
9435
|
}
|
|
9436
|
+
function deriveOriginKeys(originKeySignature, accountGenerator2) {
|
|
9437
|
+
const originKey = fromSignatureToKey(originKeySignature);
|
|
9438
|
+
const originAccount = accountGenerator2.fromMnemonicToAccount(fromEntropyKeyToMnemonic(originKey), 0);
|
|
9439
|
+
const keySet = deriveKeySet(originKey);
|
|
9440
|
+
return { originAccount, keySet };
|
|
9441
|
+
}
|
|
9441
9442
|
function deriveEtherplayAccount(key, mechanism2, accountGenerator2) {
|
|
9442
9443
|
const mnemonic = fromEntropyKeyToMnemonic(key);
|
|
9443
9444
|
return {
|
|
@@ -9456,10 +9457,7 @@ async function deriveOriginAccount(origin2, account, accountGenerator2, granted)
|
|
|
9456
9457
|
const accountMnemonic = fromEntropyKeyToMnemonic(account.localAccount.key);
|
|
9457
9458
|
const accountObject = accountGenerator2.fromMnemonicToAccount(accountMnemonic, account.localAccount.index);
|
|
9458
9459
|
const originKeySignature = await accountGenerator2.signTextMessage(originKeyMessage(origin2), accountObject.privateKey);
|
|
9459
|
-
const
|
|
9460
|
-
const originMnemonic = fromEntropyKeyToMnemonic(originKey);
|
|
9461
|
-
const originAccount = accountGenerator2.fromMnemonicToAccount(originMnemonic, 0);
|
|
9462
|
-
const keySet = deriveKeySet(originAccount.privateKey);
|
|
9460
|
+
const { originAccount, keySet } = deriveOriginKeys(originKeySignature, accountGenerator2);
|
|
9463
9461
|
const savedPublicKeyPublicationSignature = await accountGenerator2.signTextMessage(originPublicKeyPublicationMessage(origin2, keySet), accountObject.privateKey);
|
|
9464
9462
|
const savedDelegations = [];
|
|
9465
9463
|
for (const delegation of (granted == null ? void 0 : granted.delegations) || []) {
|
|
@@ -17219,7 +17217,7 @@ let n$9 = (_e = class {
|
|
|
17219
17217
|
}
|
|
17220
17218
|
static async init({ sentry: e4, configuration: o5 }) {
|
|
17221
17219
|
if (e4) return void (_e.sentry = e4);
|
|
17222
|
-
const a5 = await __vitePreload(() => import("./index
|
|
17220
|
+
const a5 = await __vitePreload(() => import("./index--WaQfBnk.js"), true ? __vite__mapDeps([0,1,2,3]) : void 0);
|
|
17223
17221
|
_e.sentry = new a5.BrowserClient({ dsn: r$a, integrations: [], stackParser: a5.defaultStackParser, transport: a5.makeFetchTransport }), _e.baseTags = { projectId: (o5 == null ? void 0 : o5.baseConfiguration.publishableKey) ?? "", sdk: t$d, sdkVersion: o$9 }, _e.processQueuedCalls();
|
|
17224
17222
|
}
|
|
17225
17223
|
static processQueuedCalls() {
|
|
@@ -17612,15 +17610,15 @@ const t$8 = async (t6) => {
|
|
|
17612
17610
|
let g2 = a5;
|
|
17613
17611
|
if ([T$1.UPGRADEABLE_V5, T$1.UPGRADEABLE_V6].includes(d2)) {
|
|
17614
17612
|
const e4 = { name: "Openfort", version: "0.5", chainId: Number(o5), verifyingContract: c3 }, t7 = { OpenfortMessage: [{ name: "hashedMessage", type: "bytes32" }] }, a6 = { hashedMessage: g2 }, { _TypedDataEncoder: s6 } = await __vitePreload(async () => {
|
|
17615
|
-
const { _TypedDataEncoder: s7 } = await import("./index-
|
|
17613
|
+
const { _TypedDataEncoder: s7 } = await import("./index-BQfjfSli.js");
|
|
17616
17614
|
return { _TypedDataEncoder: s7 };
|
|
17617
17615
|
}, true ? __vite__mapDeps([4,5,6,7,1,2,3]) : void 0);
|
|
17618
17616
|
g2 = s6.hash(e4, t7, a6);
|
|
17619
17617
|
}
|
|
17620
17618
|
const P2 = await s5.sign(g2, false, false);
|
|
17621
17619
|
if (i3 && n4 && [T$1.UPGRADEABLE_V5, T$1.UPGRADEABLE_V6].includes(d2)) {
|
|
17622
|
-
const { id: e4 } = await __vitePreload(() => import("./index-
|
|
17623
|
-
const { defaultAbiCoder: t8 } = await import("./index-
|
|
17620
|
+
const { id: e4 } = await __vitePreload(() => import("./index-BQfjfSli.js"), true ? __vite__mapDeps([4,5,6,7,1,2,3]) : void 0), { defaultAbiCoder: t7 } = await __vitePreload(async () => {
|
|
17621
|
+
const { defaultAbiCoder: t8 } = await import("./index-LuGvuWDj.js");
|
|
17624
17622
|
return { defaultAbiCoder: t8 };
|
|
17625
17623
|
}, true ? __vite__mapDeps([8,7,9,6,1,2,3]) : void 0), { hexConcat: a6 } = await __vitePreload(async () => {
|
|
17626
17624
|
const { hexConcat: a7 } = await Promise.resolve().then(() => index$1);
|
|
@@ -17666,7 +17664,7 @@ const t$7 = async ({ params: t6, signer: o5, account: n4 }) => {
|
|
|
17666
17664
|
const i3 = t6[0], d2 = t6[1];
|
|
17667
17665
|
if (!d2 || !i3) throw new A$1(E$2.INVALID_PARAMS, "personal_sign requires an address and a message");
|
|
17668
17666
|
if (d2.toLowerCase() !== n4.address.toLowerCase()) throw new A$1(E$2.INVALID_PARAMS, "personal_sign requires the signer to be the from address");
|
|
17669
|
-
const { hashMessage: p5 } = await __vitePreload(() => import("./index-
|
|
17667
|
+
const { hashMessage: p5 } = await __vitePreload(() => import("./index-BQfjfSli.js"), true ? __vite__mapDeps([4,5,6,7,1,2,3]) : void 0);
|
|
17670
17668
|
return await t$8({ hash: p5(n$a(i3)), implementationType: n4.implementationType || n4.type, chainId: Number(n4.chainId), signer: o5, address: d2, salt: n4.salt, factoryAddress: n4.factoryAddress, ownerAddress: n4.ownerAddress });
|
|
17671
17669
|
};
|
|
17672
17670
|
function a$6(t6) {
|
|
@@ -19156,7 +19154,7 @@ const r$5 = ["types", "domain", "primaryType", "message"], n$5 = (a5, n4) => {
|
|
|
19156
19154
|
if (!c3 || !h2) throw new A$1(E$2.INVALID_PARAMS, `${s5} requires an address and a typed data JSON`);
|
|
19157
19155
|
const { chainId: m2 } = await o5.detectNetwork(), I2 = n$5(h2, m2), y3 = { ...I2.types };
|
|
19158
19156
|
delete y3.EIP712Domain;
|
|
19159
|
-
const { _TypedDataEncoder: A3 } = await __vitePreload(() => import("./index-
|
|
19157
|
+
const { _TypedDataEncoder: A3 } = await __vitePreload(() => import("./index-BQfjfSli.js"), true ? __vite__mapDeps([4,5,6,7,1,2,3]) : void 0), w2 = A3.hash(I2.domain, y3, I2.message);
|
|
19160
19158
|
return await t$8({ hash: w2, implementationType: i3, chainId: m2, signer: d2, address: c3, ownerAddress: p5.ownerAddress, factoryAddress: p5.factoryAddress, salt: p5.salt });
|
|
19161
19159
|
};
|
|
19162
19160
|
var C$1;
|
|
@@ -19191,7 +19189,7 @@ let E$1 = (_f = class {
|
|
|
19191
19189
|
async getRpcProvider() {
|
|
19192
19190
|
if (!__privateGet(this, _o)) {
|
|
19193
19191
|
const e4 = await s$9.fromStorage(__privateGet(this, _t)), s5 = (e4 == null ? void 0 : e4.chainId) || (__privateGet(this, _s) ? Number(Object.keys(__privateGet(this, _s))[0]) : void 0) || 8453;
|
|
19194
|
-
await __vitePreload(() => import("./index-
|
|
19192
|
+
await __vitePreload(() => import("./index-CNWQNI4F.js"), true ? __vite__mapDeps([10,7,5,6,11,9,1,2,3]) : void 0).then((t6) => {
|
|
19195
19193
|
const e5 = __privateGet(this, _s) ? __privateGet(this, _s)[s5] : void 0;
|
|
19196
19194
|
__privateSet(this, _o, new t6.StaticJsonRpcProvider(e5 ?? t$a[s5]));
|
|
19197
19195
|
});
|
|
@@ -19235,7 +19233,7 @@ let E$1 = (_f = class {
|
|
|
19235
19233
|
const o5 = await this.getRpcProvider(), { chainId: n4 } = await o5.detectNetwork(), [h2] = s5.params || [];
|
|
19236
19234
|
h2.chainId || (h2.chainId = n4.toString());
|
|
19237
19235
|
const c3 = s$8(h2), { serialize: p5 } = await __vitePreload(async () => {
|
|
19238
|
-
const { serialize: p6 } = await import("./index-
|
|
19236
|
+
const { serialize: p6 } = await import("./index-CY5VRUKw.js").then((n5) => n5.i);
|
|
19239
19237
|
return { serialize: p6 };
|
|
19240
19238
|
}, true ? __vite__mapDeps([11,7,9]) : void 0), w2 = (t6) => ({ legacy: 0, eip2930: 1, eip1559: 2 })[t6], { gas: u4, ...l3 } = c3, g2 = { ...l3, gasLimit: u4, to: c3.to ?? void 0, type: w2(c3.type) }, f3 = p5(g2), { keccak256: S2 } = await __vitePreload(async () => {
|
|
19241
19239
|
const { keccak256: S3 } = await Promise.resolve().then(() => index);
|
|
@@ -19292,7 +19290,7 @@ let E$1 = (_f = class {
|
|
|
19292
19290
|
await __privateGet(this, _i).call(this);
|
|
19293
19291
|
try {
|
|
19294
19292
|
const e4 = parseInt(s5.params[0].chainId, 16);
|
|
19295
|
-
await t6.switchChain({ chainId: e4 }), await __vitePreload(() => import("./index-
|
|
19293
|
+
await t6.switchChain({ chainId: e4 }), await __vitePreload(() => import("./index-CNWQNI4F.js"), true ? __vite__mapDeps([10,7,5,6,11,9,1,2,3]) : void 0).then((t7) => {
|
|
19296
19294
|
const s6 = __privateGet(this, _s) ? __privateGet(this, _s)[e4] : void 0;
|
|
19297
19295
|
__privateSet(this, _o, new t7.StaticJsonRpcProvider(s6 ?? t$a[e4]));
|
|
19298
19296
|
}), __privateGet(this, _r).emit(C$1.CHAIN_CHANGED, r$b(e4));
|
|
@@ -20163,7 +20161,7 @@ class k {
|
|
|
20163
20161
|
if (!i3) throw new s$b(E$4.MISSING_SIGNER, "No account found");
|
|
20164
20162
|
const n4 = { ...r7 };
|
|
20165
20163
|
delete n4.EIP712Domain;
|
|
20166
|
-
const { _TypedDataEncoder: d2 } = await __vitePreload(() => import("./index-
|
|
20164
|
+
const { _TypedDataEncoder: d2 } = await __vitePreload(() => import("./index-BQfjfSli.js"), true ? __vite__mapDeps([4,5,6,7,1,2,3]) : void 0), h2 = d2.hash(e4, n4, t6);
|
|
20167
20165
|
return await t$8({ hash: h2, implementationType: i3.implementationType || i3.type, chainId: Number(i3.chainId), signer: s5, address: i3.address, ownerAddress: i3.ownerAddress, factoryAddress: i3.factoryAddress, salt: i3.salt });
|
|
20168
20166
|
}
|
|
20169
20167
|
async exportPrivateKey() {
|
|
@@ -20874,8 +20872,7 @@ function createOpenfortProvider(settings) {
|
|
|
20874
20872
|
const email2 = currentMechanism.email;
|
|
20875
20873
|
store.set({ step: "VerifyingOTP", mechanism: currentMechanism });
|
|
20876
20874
|
try {
|
|
20877
|
-
|
|
20878
|
-
console.log({ resultFromLoginWithOTP });
|
|
20875
|
+
await openfortInstance.auth.logInWithEmailOtp({ email: email2, otp });
|
|
20879
20876
|
await completeLogin(currentMechanism);
|
|
20880
20877
|
} catch (err2) {
|
|
20881
20878
|
const message = "failed to generate account after OTP";
|
|
@@ -20959,12 +20956,6 @@ function createOpenfortProvider(settings) {
|
|
|
20959
20956
|
throw new Error("Openfort not initialized");
|
|
20960
20957
|
}
|
|
20961
20958
|
const signature = await openfortInstance.embeddedWallet.signMessage(message);
|
|
20962
|
-
const signatureUsingMessageHash = await openfortInstance.embeddedWallet.signMessage(message, { hashMessage: true });
|
|
20963
|
-
console.log({
|
|
20964
|
-
signature,
|
|
20965
|
-
signatureUsingMessageHash,
|
|
20966
|
-
privateKey: await openfortInstance.embeddedWallet.exportPrivateKey()
|
|
20967
|
-
});
|
|
20968
20959
|
return fromSignatureToKey(signature);
|
|
20969
20960
|
}
|
|
20970
20961
|
async function generateAccount({ key, mechanism: mechanism2 }) {
|
|
@@ -23040,4 +23031,4 @@ export {
|
|
|
23040
23031
|
process$1 as p,
|
|
23041
23032
|
splitSignature as s
|
|
23042
23033
|
};
|
|
23043
|
-
//# sourceMappingURL=App-
|
|
23034
|
+
//# sourceMappingURL=App-jiH5KsZN.js.map
|