@cartridge/controller 0.9.1 → 0.9.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.
@@ -1,13 +1,13 @@
1
1
 
2
- > @cartridge/controller@0.9.1 build:deps /home/runner/work/controller/controller/packages/controller
2
+ > @cartridge/controller@0.9.2 build:deps /home/runner/work/controller/controller/packages/controller
3
3
  > pnpm build
4
4
 
5
5
 
6
- > @cartridge/controller@0.9.1 build /home/runner/work/controller/controller/packages/controller
6
+ > @cartridge/controller@0.9.2 build /home/runner/work/controller/controller/packages/controller
7
7
  > pnpm build:browser && pnpm build:node
8
8
 
9
9
 
10
- > @cartridge/controller@0.9.1 build:browser /home/runner/work/controller/controller/packages/controller
10
+ > @cartridge/controller@0.9.2 build:browser /home/runner/work/controller/controller/packages/controller
11
11
  > vite build
12
12
 
13
13
  vite v6.3.4 building for production...
@@ -19,13 +19,13 @@ rendering chunks...
19
19
  [vite:dts] Start generate declaration files...
20
20
  computing gzip size...
21
21
  dist/session.js 11.17 kB │ gzip: 3.47 kB │ map: 60.40 kB
22
- dist/provider-iltRv2Q1.js 13.48 kB │ gzip: 5.51 kB │ map: 32.57 kB
23
- dist/index.js 77.06 kB │ gzip: 20.21 kB │ map: 217.97 kB
24
- [vite:dts] Declaration files built in 4753ms.
22
+ dist/provider-C1UeMjUr.js 13.48 kB │ gzip: 5.51 kB │ map: 32.57 kB
23
+ dist/index.js 77.34 kB │ gzip: 20.27 kB │ map: 218.96 kB
24
+ [vite:dts] Declaration files built in 4818ms.
25
25
 
26
- ✓ built in 6.33s
26
+ ✓ built in 6.21s
27
27
 
28
- > @cartridge/controller@0.9.1 build:node /home/runner/work/controller/controller/packages/controller
28
+ > @cartridge/controller@0.9.2 build:node /home/runner/work/controller/controller/packages/controller
29
29
  > tsup --config tsup.node.config.ts
30
30
 
31
31
  CLI Building entry: src/node/index.ts
@@ -36,16 +36,16 @@ computing gzip size...
36
36
  CLI Cleaning output folder
37
37
  ESM Build start
38
38
  CJS Build start
39
- "constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
40
39
  "constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
41
40
  Entry module "dist/node/index.cjs" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
42
- ESM dist/node/index.js 21.13 KB
43
- ESM dist/node/index.js.map 50.30 KB
44
- ESM ⚡️ Build success in 361ms
41
+ "constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
45
42
  CJS dist/node/index.cjs 21.89 KB
46
43
  CJS dist/node/index.cjs.map 50.50 KB
47
- CJS ⚡️ Build success in 361ms
44
+ CJS ⚡️ Build success in 364ms
45
+ ESM dist/node/index.js 21.13 KB
46
+ ESM dist/node/index.js.map 50.30 KB
47
+ ESM ⚡️ Build success in 364ms
48
48
  DTS Build start
49
- DTS ⚡️ Build success in 4389ms
49
+ DTS ⚡️ Build success in 4463ms
50
50
  DTS dist/node/index.d.ts 5.26 KB
51
51
  DTS dist/node/index.d.cts 5.26 KB
@@ -1,9 +1,9 @@
1
1
 
2
- > @cartridge/controller@0.9.1 build /home/runner/work/controller/controller/packages/controller
2
+ > @cartridge/controller@0.9.2 build /home/runner/work/controller/controller/packages/controller
3
3
  > pnpm build:browser && pnpm build:node
4
4
 
5
5
 
6
- > @cartridge/controller@0.9.1 build:browser /home/runner/work/controller/controller/packages/controller
6
+ > @cartridge/controller@0.9.2 build:browser /home/runner/work/controller/controller/packages/controller
7
7
  > vite build
8
8
 
9
9
  vite v6.3.4 building for production...
@@ -15,13 +15,13 @@ rendering chunks...
15
15
  [vite:dts] Start generate declaration files...
16
16
  computing gzip size...
17
17
  dist/session.js 11.17 kB │ gzip: 3.47 kB │ map: 60.40 kB
18
- dist/provider-iltRv2Q1.js 13.48 kB │ gzip: 5.51 kB │ map: 32.57 kB
19
- dist/index.js 77.06 kB │ gzip: 20.21 kB │ map: 217.97 kB
20
- [vite:dts] Declaration files built in 4954ms.
18
+ dist/provider-C1UeMjUr.js 13.48 kB │ gzip: 5.51 kB │ map: 32.57 kB
19
+ dist/index.js 77.34 kB │ gzip: 20.27 kB │ map: 218.96 kB
20
+ [vite:dts] Declaration files built in 5212ms.
21
21
 
22
- ✓ built in 6.73s
22
+ ✓ built in 6.70s
23
23
 
24
- > @cartridge/controller@0.9.1 build:node /home/runner/work/controller/controller/packages/controller
24
+ > @cartridge/controller@0.9.2 build:node /home/runner/work/controller/controller/packages/controller
25
25
  > tsup --config tsup.node.config.ts
26
26
 
27
27
  CLI Building entry: src/node/index.ts
@@ -32,16 +32,16 @@ computing gzip size...
32
32
  CLI Cleaning output folder
33
33
  ESM Build start
34
34
  CJS Build start
35
+ "constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
35
36
  "constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
36
37
  Entry module "dist/node/index.cjs" is using named and default exports together. Consumers of your bundle will have to use `chunk.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
37
- "constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
38
38
  CJS dist/node/index.cjs 21.89 KB
39
39
  CJS dist/node/index.cjs.map 50.50 KB
40
- CJS ⚡️ Build success in 395ms
40
+ CJS ⚡️ Build success in 419ms
41
41
  ESM dist/node/index.js 21.13 KB
42
42
  ESM dist/node/index.js.map 50.30 KB
43
- ESM ⚡️ Build success in 396ms
43
+ ESM ⚡️ Build success in 421ms
44
44
  DTS Build start
45
- DTS ⚡️ Build success in 4422ms
45
+ DTS ⚡️ Build success in 4482ms
46
46
  DTS dist/node/index.d.ts 5.26 KB
47
47
  DTS dist/node/index.d.cts 5.26 KB
@@ -10,6 +10,7 @@ export declare class IFrame<CallSender extends {}> implements Modal {
10
10
  private container?;
11
11
  private onClose?;
12
12
  private child?;
13
+ private closeTimeout?;
13
14
  constructor({ id, url, preset, onClose, onConnect, methods, }: Pick<ControllerOptions, "preset"> & {
14
15
  id: string;
15
16
  url: URL;
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { WalletAccount as me, constants as $, shortString as W, num as ye } from "starknet";
2
- import { R, t as be, K as we, B as _e, v as ke, N as p, p as Ae, A as Ie } from "./provider-iltRv2Q1.js";
3
- import { F as tr, h as rr, n as nr, a as sr, b as or } from "./provider-iltRv2Q1.js";
1
+ import { WalletAccount as ge, constants as $, shortString as W, num as ye } from "starknet";
2
+ import { R, t as be, K as we, B as _e, v as ke, N as p, p as Ae, A as Ie } from "./provider-C1UeMjUr.js";
3
+ import { F as tr, h as rr, n as nr, a as sr, b as or } from "./provider-C1UeMjUr.js";
4
4
  import { connect as ve } from "starknetkit";
5
5
  import { InjectedConnector as Ee } from "starknetkit/injected";
6
6
  import { MetaMaskSDK as xe } from "@metamask/sdk";
7
7
  import { Transaction as Ce } from "@solana/web3.js";
8
- class H extends me {
8
+ class H extends ge {
9
9
  keychain;
10
10
  modal;
11
11
  options;
@@ -130,7 +130,7 @@ const Re = (r, e) => {
130
130
  }), Be = (r) => {
131
131
  const e = new Error();
132
132
  return Object.keys(r).forEach((t) => e[t] = r[t]), e;
133
- }, Qe = (r, e, t) => {
133
+ }, Te = (r, e, t) => {
134
134
  const { localName: n, local: s, remote: o, originForSending: a, originForReceiving: i } = r;
135
135
  let c = !1;
136
136
  const l = (d) => {
@@ -140,11 +140,11 @@ const Re = (r, e) => {
140
140
  t(`${n} received message from origin ${d.origin} which did not match expected origin ${i}`);
141
141
  return;
142
142
  }
143
- const h = d.data, { methodName: m, args: u, id: _ } = h;
144
- t(`${n}: Received ${m}() call`);
143
+ const h = d.data, { methodName: g, args: u, id: _ } = h;
144
+ t(`${n}: Received ${g}() call`);
145
145
  const k = (y) => (I) => {
146
- if (t(`${n}: Sending ${m}() reply`), c) {
147
- t(`${n}: Unable to send ${m}() reply due to destroyed connection`);
146
+ if (t(`${n}: Sending ${g}() reply`), c) {
147
+ t(`${n}: Unable to send ${g}() reply due to destroyed connection`);
148
148
  return;
149
149
  }
150
150
  const w = {
@@ -170,14 +170,14 @@ const Re = (r, e) => {
170
170
  throw f;
171
171
  }
172
172
  };
173
- new Promise((y) => y(e[m].call(e, d.origin).apply(e, u))).then(k(v.Fulfilled), k(v.Rejected));
173
+ new Promise((y) => y(e[g].call(e, d.origin).apply(e, u))).then(k(v.Fulfilled), k(v.Rejected));
174
174
  };
175
175
  return s.addEventListener(A.Message, l), () => {
176
176
  c = !0, s.removeEventListener(A.Message, l);
177
177
  };
178
178
  };
179
- let Ue = 0;
180
- const Te = () => ++Ue, re = ".", ne = (r) => r ? r.split(re) : [], $e = (r) => r.join(re), ze = (r, e) => {
179
+ let Qe = 0;
180
+ const Ue = () => ++Qe, re = ".", ne = (r) => r ? r.split(re) : [], $e = (r) => r.join(re), ze = (r, e) => {
181
181
  const t = ne(e || "");
182
182
  return t.push(r), $e(t);
183
183
  }, Oe = (r, e, t) => {
@@ -211,17 +211,17 @@ const Te = () => ++Ue, re = ".", ne = (r) => r ? r.split(re) : [], $e = (r) => r
211
211
  throw y.code = N.ConnectionDestroyed, y;
212
212
  }
213
213
  return new Promise((y, I) => {
214
- const w = Te(), f = (x) => {
214
+ const w = Ue(), f = (x) => {
215
215
  if (x.source !== i || x.data.penpal !== b.Reply || x.data.id !== w)
216
216
  return;
217
217
  if (l !== "*" && x.origin !== l) {
218
218
  s(`${o} received message from origin ${x.origin} which did not match expected origin ${l}`);
219
219
  return;
220
220
  }
221
- const U = x.data;
221
+ const Q = x.data;
222
222
  s(`${o}: Received ${u}() reply`), a.removeEventListener(A.Message, f);
223
- let T = U.returnValue;
224
- U.returnValueIsError && (T = Be(T)), (U.resolution === v.Fulfilled ? y : I)(T);
223
+ let U = Q.returnValue;
224
+ Q.returnValueIsError && (U = Be(U)), (Q.resolution === v.Fulfilled ? y : I)(U);
225
225
  };
226
226
  a.addEventListener(A.Message, f);
227
227
  const E = {
@@ -232,8 +232,8 @@ const Te = () => ++Ue, re = ".", ne = (r) => r ? r.split(re) : [], $e = (r) => r
232
232
  };
233
233
  i.postMessage(E, c);
234
234
  });
235
- }, m = t.reduce((u, _) => (u[_] = h(_), u), {});
236
- return Object.assign(r, Le(m)), () => {
235
+ }, g = t.reduce((u, _) => (u[_] = h(_), u), {});
236
+ return Object.assign(r, Le(g)), () => {
237
237
  d = !0;
238
238
  };
239
239
  }, Fe = (r, e, t, n, s) => {
@@ -253,11 +253,11 @@ const Te = () => ++Ue, re = ".", ne = (r) => r ? r.split(re) : [], $e = (r) => r
253
253
  originForSending: t,
254
254
  originForReceiving: e
255
255
  };
256
- i && i(), i = Qe(h, r, s), a(i), c && c.forEach((u) => {
256
+ i && i(), i = Te(h, r, s), a(i), c && c.forEach((u) => {
257
257
  delete l[u];
258
258
  }), c = d.data.methodNames;
259
- const m = Ye(l, h, c, o, s);
260
- return a(m), l;
259
+ const g = Ye(l, h, c, o, s);
260
+ return a(g), l;
261
261
  };
262
262
  }, We = (r, e, t, n) => (s) => {
263
263
  if (!s.source)
@@ -296,13 +296,13 @@ const Te = () => ++Ue, re = ".", ne = (r) => r ? r.split(re) : [], $e = (r) => r
296
296
  let { iframe: e, methods: t = {}, childOrigin: n, timeout: s, debug: o = !1 } = r;
297
297
  const a = Se(o), i = Re("Parent", a), { onDestroy: c, destroy: l } = i;
298
298
  n || (qe(e), n = Me(e.src));
299
- const d = n === "null" ? "*" : n, h = se(t), m = We(a, h, n, d), u = Fe(h, n, d, i, a);
299
+ const d = n === "null" ? "*" : n, h = se(t), g = We(a, h, n, d), u = Fe(h, n, d, i, a);
300
300
  return {
301
301
  promise: new Promise((k, y) => {
302
302
  const I = je(s, l), w = (f) => {
303
303
  if (!(f.source !== e.contentWindow || !f.data)) {
304
304
  if (f.data.penpal === b.Syn) {
305
- m(f);
305
+ g(f);
306
306
  return;
307
307
  }
308
308
  if (f.data.penpal === b.Ack) {
@@ -327,6 +327,7 @@ class Ge {
327
327
  container;
328
328
  onClose;
329
329
  child;
330
+ closeTimeout;
330
331
  constructor({
331
332
  id: e,
332
333
  url: t,
@@ -341,8 +342,8 @@ class Ge {
341
342
  const i = document.createElement("iframe");
342
343
  i.src = t.toString(), i.id = e, i.style.border = "none", i.sandbox.add("allow-forms"), i.sandbox.add("allow-popups"), i.sandbox.add("allow-popups-to-escape-sandbox"), i.sandbox.add("allow-scripts"), i.sandbox.add("allow-same-origin"), i.allow = "publickey-credentials-create *; publickey-credentials-get *; clipboard-write", document.hasStorageAccess && i.sandbox.add("allow-storage-access-by-user-activation");
343
344
  const c = document.createElement("div");
344
- c.id = "controller", c.style.position = "fixed", c.style.height = "100%", c.style.width = "100%", c.style.top = "0", c.style.left = "0", c.style.zIndex = "10000", c.style.backgroundColor = "rgba(0,0,0,0.6)", c.style.display = "flex", c.style.alignItems = "center", c.style.justifyContent = "center", c.style.visibility = "hidden", c.style.opacity = "0", c.style.transition = "opacity 0.2s ease", c.style.pointerEvents = "auto", c.appendChild(i), c.addEventListener("click", (h) => {
345
- h.target === c && (e === "controller-keychain" && this.child && this.child.reset?.().catch((m) => console.error("Error resetting context:", m)), this.close());
345
+ c.id = "controller", c.style.position = "fixed", c.style.height = "100%", c.style.width = "100%", c.style.top = "0", c.style.left = "0", c.style.zIndex = "10000", c.style.backgroundColor = "rgba(0,0,0,0.6)", c.style.display = "none", c.style.alignItems = "center", c.style.justifyContent = "center", c.style.transition = "opacity 0.2s ease", c.style.opacity = "0", c.style.pointerEvents = "auto", c.appendChild(i), c.addEventListener("click", (h) => {
346
+ h.target === c && (e === "controller-keychain" && this.child && this.child.reset?.().catch((g) => console.error("Error resetting context:", g)), this.close());
346
347
  }), this.iframe = i, this.container = c, Xe({
347
348
  iframe: this.iframe,
348
349
  methods: {
@@ -366,10 +367,14 @@ class Ge {
366
367
  document.body && e === "controller-keychain" && !d && document.body.appendChild(c), this.onClose = s;
367
368
  }
368
369
  open() {
369
- !this.container || typeof document > "u" || !document.body || (document.body.style.overflow = "hidden", this.container.style.visibility = "visible", this.container.style.opacity = "1");
370
+ !this.container || typeof document > "u" || !document.body || (this.closeTimeout && (clearTimeout(this.closeTimeout), this.closeTimeout = void 0), document.body.style.overflow = "hidden", this.container.style.display = "flex", requestAnimationFrame(() => {
371
+ this.container && (this.container.style.opacity = "1");
372
+ }));
370
373
  }
371
374
  close() {
372
- !this.container || typeof document > "u" || !document.body || (this.onClose?.(), document.body.style.overflow = "auto", this.container.style.visibility = "hidden", this.container.style.opacity = "0");
375
+ !this.container || typeof document > "u" || !document.body || (this.onClose?.(), document.body.style.overflow = "auto", this.container.style.opacity = "0", this.closeTimeout = setTimeout(() => {
376
+ this.container && (this.container.style.display = "none"), this.closeTimeout = void 0;
377
+ }, 200));
373
378
  }
374
379
  sendBackward() {
375
380
  this.container && (this.container.style.zIndex = "9999");
@@ -387,7 +392,7 @@ class Ge {
387
392
  }
388
393
  }
389
394
  isOpen() {
390
- return this.iframe?.style.display !== "none";
395
+ return this.container?.style.display !== "none";
391
396
  }
392
397
  }
393
398
  const Ve = "6.13.7";
@@ -559,12 +564,12 @@ function dt(r, e = !1) {
559
564
  }
560
565
  return [t, n];
561
566
  }
562
- const ht = (r, e, t) => r << t | e >>> 32 - t, ut = (r, e, t) => e << t | r >>> 32 - t, ft = (r, e, t) => e << t - 32 | r >>> 64 - t, pt = (r, e, t) => r << t - 32 | e >>> 64 - t, [ie, ce, le] = [[], [], []], gt = /* @__PURE__ */ BigInt(0), P = /* @__PURE__ */ BigInt(1), mt = /* @__PURE__ */ BigInt(2), yt = /* @__PURE__ */ BigInt(7), bt = /* @__PURE__ */ BigInt(256), wt = /* @__PURE__ */ BigInt(113);
567
+ const ht = (r, e, t) => r << t | e >>> 32 - t, ut = (r, e, t) => e << t | r >>> 32 - t, ft = (r, e, t) => e << t - 32 | r >>> 64 - t, pt = (r, e, t) => r << t - 32 | e >>> 64 - t, [ie, ce, le] = [[], [], []], mt = /* @__PURE__ */ BigInt(0), P = /* @__PURE__ */ BigInt(1), gt = /* @__PURE__ */ BigInt(2), yt = /* @__PURE__ */ BigInt(7), bt = /* @__PURE__ */ BigInt(256), wt = /* @__PURE__ */ BigInt(113);
563
568
  for (let r = 0, e = P, t = 1, n = 0; r < 24; r++) {
564
569
  [t, n] = [n, (2 * t + 3 * n) % 5], ie.push(2 * (5 * n + t)), ce.push((r + 1) * (r + 2) / 2 % 64);
565
- let s = gt;
570
+ let s = mt;
566
571
  for (let o = 0; o < 7; o++)
567
- e = (e << P ^ (e >> yt) * wt) % bt, e & mt && (s ^= P << (P << /* @__PURE__ */ BigInt(o)) - P);
572
+ e = (e << P ^ (e >> yt) * wt) % bt, e & gt && (s ^= P << (P << /* @__PURE__ */ BigInt(o)) - P);
568
573
  le.push(s);
569
574
  }
570
575
  const [_t, kt] = /* @__PURE__ */ dt(le, !0), J = (r, e, t) => t > 32 ? ft(r, e, t) : ht(r, e, t), Z = (r, e, t) => t > 32 ? pt(r, e, t) : ut(r, e, t);
@@ -574,9 +579,9 @@ function At(r, e = 24) {
574
579
  for (let a = 0; a < 10; a++)
575
580
  t[a] = r[a] ^ r[a + 10] ^ r[a + 20] ^ r[a + 30] ^ r[a + 40];
576
581
  for (let a = 0; a < 10; a += 2) {
577
- const i = (a + 8) % 10, c = (a + 2) % 10, l = t[c], d = t[c + 1], h = J(l, d, 1) ^ t[i], m = Z(l, d, 1) ^ t[i + 1];
582
+ const i = (a + 8) % 10, c = (a + 2) % 10, l = t[c], d = t[c + 1], h = J(l, d, 1) ^ t[i], g = Z(l, d, 1) ^ t[i + 1];
578
583
  for (let u = 0; u < 50; u += 10)
579
- r[a + u] ^= h, r[a + u + 1] ^= m;
584
+ r[a + u] ^= h, r[a + u + 1] ^= g;
580
585
  }
581
586
  let s = r[2], o = r[3];
582
587
  for (let a = 0; a < 24; a++) {
@@ -721,7 +726,7 @@ function St(r) {
721
726
  e = e * xt + Rt[r[t]];
722
727
  return e;
723
728
  }
724
- function g(r) {
729
+ function m(r) {
725
730
  if (D(typeof r == "string", "invalid address", "address", r), r.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
726
731
  r.startsWith("0x") || (r = "0x" + r);
727
732
  const e = ee(r);
@@ -880,9 +885,9 @@ class Nt {
880
885
  this.MMSDK.getProvider()?.request({
881
886
  method: "eth_accounts"
882
887
  }).then((e) => {
883
- e && e.length > 0 && (this.account = g(e[0]), this.connectedAccounts = e.map(g));
888
+ e && e.length > 0 && (this.account = m(e[0]), this.connectedAccounts = e.map(m));
884
889
  }), this.MMSDK.getProvider()?.on("accountsChanged", (e) => {
885
- Array.isArray(e) && e.length > 0 && (this.account = g(e?.[0]), this.connectedAccounts = e.map(g));
890
+ Array.isArray(e) && e.length > 0 && (this.account = m(e?.[0]), this.connectedAccounts = e.map(m));
886
891
  });
887
892
  });
888
893
  }
@@ -909,8 +914,8 @@ class Nt {
909
914
  throw new Error("MetaMask is not available");
910
915
  const e = await this.MMSDK.connect();
911
916
  if (e && e.length > 0)
912
- return this.account = g(e[0]), this.connectedAccounts = e.map(
913
- (t) => g(t)
917
+ return this.account = m(e[0]), this.connectedAccounts = e.map(
918
+ (t) => m(t)
914
919
  ), { success: !0, wallet: this.type, account: this.account };
915
920
  throw new Error("No accounts found");
916
921
  } catch (e) {
@@ -1140,7 +1145,7 @@ class Mt {
1140
1145
  }
1141
1146
  }
1142
1147
  const Bt = "io.rabby";
1143
- class Qt {
1148
+ class Tt {
1144
1149
  type = "rabby";
1145
1150
  platform = "ethereum";
1146
1151
  account = void 0;
@@ -1151,9 +1156,9 @@ class Qt {
1151
1156
  this.provider = this.store.getProviders().find((e) => e.info.rdns === Bt), this.provider?.provider.request({
1152
1157
  method: "eth_accounts"
1153
1158
  }).then((e) => {
1154
- this.connectedAccounts = e.map(g), e.length > 0 && (this.account = g(e?.[0]));
1159
+ this.connectedAccounts = e.map(m), e.length > 0 && (this.account = m(e?.[0]));
1155
1160
  }), this.provider?.provider?.on("accountsChanged", (e) => {
1156
- e && (this.connectedAccounts = e.map((t) => g(t)), this.account = g(e?.[0]));
1161
+ e && (this.connectedAccounts = e.map((t) => m(t)), this.account = m(e?.[0]));
1157
1162
  });
1158
1163
  }
1159
1164
  isAvailable() {
@@ -1172,7 +1177,7 @@ class Qt {
1172
1177
  };
1173
1178
  }
1174
1179
  async connect(e) {
1175
- if (e && this.connectedAccounts.includes(g(e)) && (this.account = g(e)), this.account)
1180
+ if (e && this.connectedAccounts.includes(m(e)) && (this.account = m(e)), this.account)
1176
1181
  return { success: !0, wallet: this.type, account: this.account };
1177
1182
  try {
1178
1183
  if (!this.isAvailable())
@@ -1181,7 +1186,7 @@ class Qt {
1181
1186
  method: "eth_requestAccounts"
1182
1187
  });
1183
1188
  if (t && t.length > 0)
1184
- return this.account = g(t[0]), this.connectedAccounts = t.map(g), { success: !0, wallet: this.type, account: this.account };
1189
+ return this.account = m(t[0]), this.connectedAccounts = t.map(m), { success: !0, wallet: this.type, account: this.account };
1185
1190
  throw new Error("No accounts found");
1186
1191
  } catch (t) {
1187
1192
  return console.error("Error connecting to Rabby:", t), {
@@ -1306,7 +1311,7 @@ class Qt {
1306
1311
  }
1307
1312
  }
1308
1313
  }
1309
- class Ut {
1314
+ class Qt {
1310
1315
  walletAdapters;
1311
1316
  constructor() {
1312
1317
  if (this.walletAdapters = /* @__PURE__ */ new Map(), typeof window > "u")
@@ -1317,7 +1322,7 @@ class Ut {
1317
1322
  t.isAvailable() && this.walletAdapters.set("phantom", t);
1318
1323
  const n = new Pt();
1319
1324
  n.isAvailable() && this.walletAdapters.set("argent", n);
1320
- const s = new Qt();
1325
+ const s = new Tt();
1321
1326
  s.isAvailable() && this.walletAdapters.set("rabby", s), window.wallet_bridge = this;
1322
1327
  }
1323
1328
  getIFrameMethods() {
@@ -1378,7 +1383,7 @@ class Ut {
1378
1383
  getConnectedWalletAdapter(e) {
1379
1384
  let t;
1380
1385
  if (typeof e == "string") {
1381
- const n = g(e);
1386
+ const n = m(e);
1382
1387
  t = this.walletAdapters.values().find((s) => s.getConnectedAccounts().includes(n));
1383
1388
  } else
1384
1389
  t = this.walletAdapters.get(e);
@@ -1449,7 +1454,7 @@ class Ut {
1449
1454
  }
1450
1455
  }
1451
1456
  }
1452
- class Tt extends Ge {
1457
+ class Ut extends Ge {
1453
1458
  walletBridge;
1454
1459
  constructor({
1455
1460
  url: e,
@@ -1460,7 +1465,7 @@ class Tt extends Ge {
1460
1465
  tokens: a,
1461
1466
  ...i
1462
1467
  }) {
1463
- const c = new URL(e ?? we), l = new Ut();
1468
+ const c = new URL(e ?? we), l = new Qt();
1464
1469
  t && c.searchParams.set(
1465
1470
  "policies",
1466
1471
  encodeURIComponent(JSON.stringify(t))
@@ -1494,7 +1499,7 @@ class Ht extends _e {
1494
1499
  { rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet" }
1495
1500
  ], ...e.chains || []], s = e.defaultChainId || $.StarknetChainId.SN_MAIN;
1496
1501
  this.selectedChain = s, this.chains = /* @__PURE__ */ new Map(), this.iframes = {
1497
- keychain: new Tt({
1502
+ keychain: new Ut({
1498
1503
  ...e,
1499
1504
  onClose: this.keychain?.reset,
1500
1505
  onConnect: (o) => {
@@ -1512,7 +1517,9 @@ class Ht extends _e {
1512
1517
  try {
1513
1518
  await this.disconnect(), document.querySelectorAll('iframe[id^="controller-"]').forEach((t) => {
1514
1519
  const n = t.parentElement;
1515
- n && (n.style.visibility = "hidden", n.style.opacity = "0");
1520
+ n && (n.style.opacity = "0", setTimeout(() => {
1521
+ n.style.display = "none";
1522
+ }, 200));
1516
1523
  }), document.body && (document.body.style.overflow = "auto"), window.location.reload();
1517
1524
  } catch (e) {
1518
1525
  throw console.error("Logout failed:", e), e;
@@ -2321,20 +2328,20 @@ var $t = [
2321
2328
  total_supply: null,
2322
2329
  logo_url: "https://assets.underware.gg/pistols/fame.svg"
2323
2330
  }
2324
- ], ge = {
2331
+ ], me = {
2325
2332
  theme: {
2326
2333
  name: "Cartridge",
2327
2334
  icon: "icon.svg"
2328
2335
  }
2329
- }, Q = "https://static.cartridge.gg/presets";
2336
+ }, T = "https://static.cartridge.gg/presets";
2330
2337
  async function F() {
2331
2338
  try {
2332
- const r = await fetch(`${Q}/index.json`);
2339
+ const r = await fetch(`${T}/index.json`);
2333
2340
  if (!r.ok)
2334
2341
  throw new Error(`Failed to load configs index: ${r.statusText}`);
2335
2342
  return await r.json();
2336
2343
  } catch (r) {
2337
- return console.error("Error loading configs index:", r), { configs: [], baseUrl: Q };
2344
+ return console.error("Error loading configs index:", r), { configs: [], baseUrl: T };
2338
2345
  }
2339
2346
  }
2340
2347
  async function qt() {
@@ -2342,7 +2349,7 @@ async function qt() {
2342
2349
  }
2343
2350
  async function Xt(r) {
2344
2351
  try {
2345
- const n = `${(await F()).baseUrl || Q}/${r}`, s = await fetch(`${n}/config.json`);
2352
+ const n = `${(await F()).baseUrl || T}/${r}`, s = await fetch(`${n}/config.json`);
2346
2353
  if (!s.ok)
2347
2354
  throw new Error(
2348
2355
  `Failed to load config ${r}: ${s.statusText}`
@@ -2373,7 +2380,7 @@ async function Xt(r) {
2373
2380
  }
2374
2381
  }
2375
2382
  async function Gt() {
2376
- const r = await F(), e = r.configs, t = r.baseUrl || Q, n = {};
2383
+ const r = await F(), e = r.configs, t = r.baseUrl || T, n = {};
2377
2384
  return await Promise.all(
2378
2385
  e.map(async (s) => {
2379
2386
  try {
@@ -2388,17 +2395,17 @@ async function Gt() {
2388
2395
  })
2389
2396
  ), n;
2390
2397
  }
2391
- ge.theme.icon = "https://static.cartridge.gg/presets/cartridge/icon.svg";
2392
- var Vt = $t, Jt = ge.theme;
2398
+ me.theme.icon = "https://static.cartridge.gg/presets/cartridge/icon.svg";
2399
+ var Vt = $t, Jt = me.theme;
2393
2400
  export {
2394
2401
  Pt as ArgentWallet,
2395
2402
  tr as FeeSource,
2396
2403
  Nt as MetaMaskWallet,
2397
2404
  p as NotReadyToConnect,
2398
2405
  Mt as PhantomWallet,
2399
- Qt as RabbyWallet,
2406
+ Tt as RabbyWallet,
2400
2407
  R as ResponseCodes,
2401
- Ut as WalletBridge,
2408
+ Qt as WalletBridge,
2402
2409
  Ht as default,
2403
2410
  Jt as defaultTheme,
2404
2411
  Vt as erc20Metadata,