@cartridge/controller 0.7.9 → 0.7.11

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.7.9 build:deps /home/runner/work/controller/controller/packages/controller
2
+ > @cartridge/controller@0.7.11 build:deps /home/runner/work/controller/controller/packages/controller
3
3
  > pnpm build
4
4
 
5
5
 
6
- > @cartridge/controller@0.7.9 build /home/runner/work/controller/controller/packages/controller
6
+ > @cartridge/controller@0.7.11 build /home/runner/work/controller/controller/packages/controller
7
7
  > pnpm build:browser && pnpm build:node
8
8
 
9
9
 
10
- > @cartridge/controller@0.7.9 build:browser /home/runner/work/controller/controller/packages/controller
10
+ > @cartridge/controller@0.7.11 build:browser /home/runner/work/controller/controller/packages/controller
11
11
  > vite build
12
12
 
13
13
  vite v6.1.0 building for production...
@@ -18,14 +18,14 @@ rendering chunks...
18
18
 
19
19
  [vite:dts] Start generate declaration files...
20
20
  computing gzip size...
21
- dist/session.js  10.81 kB │ gzip: 3.37 kB │ map: 56.40 kB
22
- dist/provider-CH2PlazB.js  23.20 kB │ gzip: 13.54 kB │ map: 40.69 kB
23
- dist/index.js 135.41 kB │ gzip: 24.24 kB │ map: 257.61 kB
24
- [vite:dts] Declaration files built in 3492ms.
21
+ dist/session.js  10.84 kB │ gzip: 3.38 kB │ map: 56.54 kB
22
+ dist/provider-CyO7_h7r.js  23.30 kB │ gzip: 13.58 kB │ map: 40.95 kB
23
+ dist/index.js 135.90 kB │ gzip: 24.37 kB │ map: 258.64 kB
24
+ [vite:dts] Declaration files built in 3359ms.
25
25
 
26
- ✓ built in 4.25s
26
+ ✓ built in 4.17s
27
27
 
28
- > @cartridge/controller@0.7.9 build:node /home/runner/work/controller/controller/packages/controller
28
+ > @cartridge/controller@0.7.11 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
@@ -41,11 +41,11 @@ Entry module "dist/node/index.cjs" is using named and default exports together.
41
41
  "constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
42
42
  CJS dist/node/index.cjs 31.90 KB
43
43
  CJS dist/node/index.cjs.map 58.78 KB
44
- CJS ⚡️ Build success in 402ms
44
+ CJS ⚡️ Build success in 389ms
45
45
  ESM dist/node/index.js 31.14 KB
46
46
  ESM dist/node/index.js.map 58.58 KB
47
- ESM ⚡️ Build success in 403ms
47
+ ESM ⚡️ Build success in 389ms
48
48
  DTS Build start
49
- DTS ⚡️ Build success in 3089ms
49
+ DTS ⚡️ Build success in 3222ms
50
50
  DTS dist/node/index.d.ts 5.09 KB
51
51
  DTS dist/node/index.d.cts 5.09 KB
@@ -1,9 +1,9 @@
1
1
 
2
- > @cartridge/controller@0.7.9 build /home/runner/work/controller/controller/packages/controller
2
+ > @cartridge/controller@0.7.11 build /home/runner/work/controller/controller/packages/controller
3
3
  > pnpm build:browser && pnpm build:node
4
4
 
5
5
 
6
- > @cartridge/controller@0.7.9 build:browser /home/runner/work/controller/controller/packages/controller
6
+ > @cartridge/controller@0.7.11 build:browser /home/runner/work/controller/controller/packages/controller
7
7
  > vite build
8
8
 
9
9
  vite v6.1.0 building for production...
@@ -14,14 +14,14 @@ rendering chunks...
14
14
 
15
15
  [vite:dts] Start generate declaration files...
16
16
  computing gzip size...
17
- dist/session.js  10.81 kB │ gzip: 3.37 kB │ map: 56.40 kB
18
- dist/provider-CH2PlazB.js  23.20 kB │ gzip: 13.54 kB │ map: 40.69 kB
19
- dist/index.js 135.41 kB │ gzip: 24.24 kB │ map: 257.61 kB
20
- [vite:dts] Declaration files built in 3311ms.
17
+ dist/session.js  10.84 kB │ gzip: 3.38 kB │ map: 56.54 kB
18
+ dist/provider-CyO7_h7r.js  23.30 kB │ gzip: 13.58 kB │ map: 40.95 kB
19
+ dist/index.js 135.90 kB │ gzip: 24.37 kB │ map: 258.64 kB
20
+ [vite:dts] Declaration files built in 3354ms.
21
21
 
22
- ✓ built in 4.34s
22
+ ✓ built in 4.32s
23
23
 
24
- > @cartridge/controller@0.7.9 build:node /home/runner/work/controller/controller/packages/controller
24
+ > @cartridge/controller@0.7.11 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
@@ -40,8 +40,8 @@ Entry module "dist/node/index.cjs" is using named and default exports together.
40
40
  ESM ⚡️ Build success in 325ms
41
41
  CJS dist/node/index.cjs 31.90 KB
42
42
  CJS dist/node/index.cjs.map 58.78 KB
43
- CJS ⚡️ Build success in 326ms
43
+ CJS ⚡️ Build success in 325ms
44
44
  DTS Build start
45
- DTS ⚡️ Build success in 3251ms
45
+ DTS ⚡️ Build success in 3307ms
46
46
  DTS dist/node/index.d.ts 5.09 KB
47
47
  DTS dist/node/index.d.cts 5.09 KB
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { WalletAccount as L, shortString as M, num as O } from "starknet";
2
- import { R as A, t as Y, K as $, P as W, B as H, N as b, p as K, A as q } from "./provider-CH2PlazB.js";
3
- import { h as Oe, n as Ye, a as $e, b as We } from "./provider-CH2PlazB.js";
2
+ import { R as A, t as Y, K as $, P as W, B as H, N as u, p as K, A as q } from "./provider-CyO7_h7r.js";
3
+ import { F as Oe, h as Ye, n as $e, a as We, b as He } from "./provider-CyO7_h7r.js";
4
4
  import { MetaMaskSDK as G } from "@metamask/sdk";
5
5
  import { Transaction as V } from "@solana/web3.js";
6
6
  import { connect as J } from "starknetkit";
@@ -31,7 +31,8 @@ class z extends L {
31
31
  e,
32
32
  void 0,
33
33
  void 0,
34
- !1
34
+ !1,
35
+ this.options?.feeSource
35
36
  );
36
37
  if (r.code === A.SUCCESS) {
37
38
  t(r);
@@ -77,18 +78,18 @@ class z extends L {
77
78
  });
78
79
  }
79
80
  }
80
- var u;
81
+ var y;
81
82
  (function(o) {
82
83
  o.Call = "call", o.Reply = "reply", o.Syn = "syn", o.SynAck = "synAck", o.Ack = "ack";
83
- })(u || (u = {}));
84
+ })(y || (y = {}));
84
85
  var C;
85
86
  (function(o) {
86
87
  o.Fulfilled = "fulfilled", o.Rejected = "rejected";
87
88
  })(C || (C = {}));
88
- var S;
89
+ var E;
89
90
  (function(o) {
90
91
  o.ConnectionDestroyed = "ConnectionDestroyed", o.ConnectionTimeout = "ConnectionTimeout", o.NoIframeSrc = "NoIframeSrc";
91
- })(S || (S = {}));
92
+ })(E || (E = {}));
92
93
  var D;
93
94
  (function(o) {
94
95
  o.DataCloneError = "DataCloneError";
@@ -116,7 +117,7 @@ const Z = (o, e) => {
116
117
  "http:": "80",
117
118
  "https:": "443"
118
119
  }, ne = /^(https?:)?\/\/([^/:]+)?(:(\d+))?/, oe = ["file:", "data:"], re = (o) => {
119
- if (o && oe.find((i) => o.startsWith(i)))
120
+ if (o && oe.find((s) => o.startsWith(s)))
120
121
  return "null";
121
122
  const e = document.location, t = ne.exec(o);
122
123
  let n, r, a;
@@ -131,49 +132,49 @@ const Z = (o, e) => {
131
132
  const e = new Error();
132
133
  return Object.keys(o).forEach((t) => e[t] = o[t]), e;
133
134
  }, ie = (o, e, t) => {
134
- const { localName: n, local: r, remote: a, originForSending: c, originForReceiving: i } = o;
135
- let s = !1;
135
+ const { localName: n, local: r, remote: a, originForSending: c, originForReceiving: s } = o;
136
+ let i = !1;
136
137
  const l = (d) => {
137
- if (d.source !== a || d.data.penpal !== u.Call)
138
+ if (d.source !== a || d.data.penpal !== y.Call)
138
139
  return;
139
- if (i !== "*" && d.origin !== i) {
140
- t(`${n} received message from origin ${d.origin} which did not match expected origin ${i}`);
140
+ if (s !== "*" && d.origin !== s) {
141
+ t(`${n} received message from origin ${d.origin} which did not match expected origin ${s}`);
141
142
  return;
142
143
  }
143
- const p = d.data, { methodName: h, args: m, id: v } = p;
144
+ const p = d.data, { methodName: h, args: g, id: f } = p;
144
145
  t(`${n}: Received ${h}() call`);
145
- const w = (f) => (k) => {
146
- if (t(`${n}: Sending ${h}() reply`), s) {
146
+ const w = (b) => (k) => {
147
+ if (t(`${n}: Sending ${h}() reply`), i) {
147
148
  t(`${n}: Unable to send ${h}() reply due to destroyed connection`);
148
149
  return;
149
150
  }
150
- const y = {
151
- penpal: u.Reply,
152
- id: v,
153
- resolution: f,
151
+ const v = {
152
+ penpal: y.Reply,
153
+ id: f,
154
+ resolution: b,
154
155
  returnValue: k
155
156
  };
156
- f === C.Rejected && k instanceof Error && (y.returnValue = N(k), y.returnValueIsError = !0);
157
+ b === C.Rejected && k instanceof Error && (v.returnValue = N(k), v.returnValueIsError = !0);
157
158
  try {
158
- a.postMessage(y, c);
159
- } catch (g) {
160
- if (g.name === D.DataCloneError) {
159
+ a.postMessage(v, c);
160
+ } catch (m) {
161
+ if (m.name === D.DataCloneError) {
161
162
  const I = {
162
- penpal: u.Reply,
163
- id: v,
163
+ penpal: y.Reply,
164
+ id: f,
164
165
  resolution: C.Rejected,
165
- returnValue: N(g),
166
+ returnValue: N(m),
166
167
  returnValueIsError: !0
167
168
  };
168
169
  a.postMessage(I, c);
169
170
  }
170
- throw g;
171
+ throw m;
171
172
  }
172
173
  };
173
- new Promise((f) => f(e[h].call(e, d.origin).apply(e, m))).then(w(C.Fulfilled), w(C.Rejected));
174
+ new Promise((b) => b(e[h].call(e, d.origin).apply(e, g))).then(w(C.Fulfilled), w(C.Rejected));
174
175
  };
175
176
  return r.addEventListener(_.Message, l), () => {
176
- s = !0, r.removeEventListener(_.Message, l);
177
+ i = !0, r.removeEventListener(_.Message, l);
177
178
  };
178
179
  };
179
180
  let se = 0;
@@ -195,50 +196,50 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
195
196
  le(e, t, o[t]);
196
197
  return e;
197
198
  }, me = (o, e, t, n, r) => {
198
- const { localName: a, local: c, remote: i, originForSending: s, originForReceiving: l } = e;
199
+ const { localName: a, local: c, remote: s, originForSending: i, originForReceiving: l } = e;
199
200
  let d = !1;
200
201
  r(`${a}: Connecting call sender`);
201
- const p = (m) => (...v) => {
202
- r(`${a}: Sending ${m}() call`);
202
+ const p = (g) => (...f) => {
203
+ r(`${a}: Sending ${g}() call`);
203
204
  let w;
204
205
  try {
205
- i.closed && (w = !0);
206
+ s.closed && (w = !0);
206
207
  } catch {
207
208
  w = !0;
208
209
  }
209
210
  if (w && n(), d) {
210
- const f = new Error(`Unable to send ${m}() call due to destroyed connection`);
211
- throw f.code = S.ConnectionDestroyed, f;
211
+ const b = new Error(`Unable to send ${g}() call due to destroyed connection`);
212
+ throw b.code = E.ConnectionDestroyed, b;
212
213
  }
213
- return new Promise((f, k) => {
214
- const y = ce(), g = (x) => {
215
- if (x.source !== i || x.data.penpal !== u.Reply || x.data.id !== y)
214
+ return new Promise((b, k) => {
215
+ const v = ce(), m = (x) => {
216
+ if (x.source !== s || x.data.penpal !== y.Reply || x.data.id !== v)
216
217
  return;
217
218
  if (l !== "*" && x.origin !== l) {
218
219
  r(`${a} received message from origin ${x.origin} which did not match expected origin ${l}`);
219
220
  return;
220
221
  }
221
- const E = x.data;
222
- r(`${a}: Received ${m}() reply`), c.removeEventListener(_.Message, g);
223
- let P = E.returnValue;
224
- E.returnValueIsError && (P = ae(P)), (E.resolution === C.Fulfilled ? f : k)(P);
222
+ const R = x.data;
223
+ r(`${a}: Received ${g}() reply`), c.removeEventListener(_.Message, m);
224
+ let P = R.returnValue;
225
+ R.returnValueIsError && (P = ae(P)), (R.resolution === C.Fulfilled ? b : k)(P);
225
226
  };
226
- c.addEventListener(_.Message, g);
227
+ c.addEventListener(_.Message, m);
227
228
  const I = {
228
- penpal: u.Call,
229
- id: y,
230
- methodName: m,
231
- args: v
229
+ penpal: y.Call,
230
+ id: v,
231
+ methodName: g,
232
+ args: f
232
233
  };
233
- i.postMessage(I, s);
234
+ s.postMessage(I, i);
234
235
  });
235
- }, h = t.reduce((m, v) => (m[v] = p(v), m), {});
236
+ }, h = t.reduce((g, f) => (g[f] = p(f), g), {});
236
237
  return Object.assign(o, ge(h)), () => {
237
238
  d = !0;
238
239
  };
239
240
  }, he = (o, e, t, n, r) => {
240
241
  const { destroy: a, onDestroy: c } = n;
241
- let i, s;
242
+ let s, i;
242
243
  const l = {};
243
244
  return (d) => {
244
245
  if (e !== "*" && d.origin !== e) {
@@ -253,10 +254,10 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
253
254
  originForSending: t,
254
255
  originForReceiving: e
255
256
  };
256
- i && i(), i = ie(p, o, r), c(i), s && s.forEach((m) => {
257
- delete l[m];
258
- }), s = d.data.methodNames;
259
- const h = me(l, p, s, a, r);
257
+ s && s(), s = ie(p, o, r), c(s), i && i.forEach((g) => {
258
+ delete l[g];
259
+ }), i = d.data.methodNames;
260
+ const h = me(l, p, i, a, r);
260
261
  return c(h), l;
261
262
  };
262
263
  }, fe = (o, e, t, n) => (r) => {
@@ -268,7 +269,7 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
268
269
  }
269
270
  o("Parent: Handshake - Received SYN, responding with SYN-ACK");
270
271
  const a = {
271
- penpal: u.SynAck,
272
+ penpal: y.SynAck,
272
273
  methodNames: Object.keys(e)
273
274
  };
274
275
  r.source.postMessage(a, n);
@@ -283,37 +284,37 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
283
284
  let t;
284
285
  return o !== void 0 && (t = window.setTimeout(() => {
285
286
  const n = new Error(`Connection timed out after ${o}ms`);
286
- n.code = S.ConnectionTimeout, e(n);
287
+ n.code = E.ConnectionTimeout, e(n);
287
288
  }, o)), () => {
288
289
  clearTimeout(t);
289
290
  };
290
291
  }, ve = (o) => {
291
292
  if (!o.src && !o.srcdoc) {
292
293
  const e = new Error("Iframe must have src or srcdoc property defined.");
293
- throw e.code = S.NoIframeSrc, e;
294
+ throw e.code = E.NoIframeSrc, e;
294
295
  }
295
296
  }, we = (o) => {
296
297
  let { iframe: e, methods: t = {}, childOrigin: n, timeout: r, debug: a = !1 } = o;
297
- const c = ee(a), i = Z("Parent", c), { onDestroy: s, destroy: l } = i;
298
+ const c = ee(a), s = Z("Parent", c), { onDestroy: i, destroy: l } = s;
298
299
  n || (ve(e), n = re(e.src));
299
- const d = n === "null" ? "*" : n, p = T(t), h = fe(c, p, n, d), m = he(p, n, d, i, c);
300
+ const d = n === "null" ? "*" : n, p = T(t), h = fe(c, p, n, d), g = he(p, n, d, s, c);
300
301
  return {
301
- promise: new Promise((w, f) => {
302
- const k = ye(r, l), y = (g) => {
303
- if (!(g.source !== e.contentWindow || !g.data)) {
304
- if (g.data.penpal === u.Syn) {
305
- h(g);
302
+ promise: new Promise((w, b) => {
303
+ const k = ye(r, l), v = (m) => {
304
+ if (!(m.source !== e.contentWindow || !m.data)) {
305
+ if (m.data.penpal === y.Syn) {
306
+ h(m);
306
307
  return;
307
308
  }
308
- if (g.data.penpal === u.Ack) {
309
- const I = m(g);
309
+ if (m.data.penpal === y.Ack) {
310
+ const I = g(m);
310
311
  I && (k(), w(I));
311
312
  return;
312
313
  }
313
314
  }
314
315
  };
315
- window.addEventListener(_.Message, y), c("Parent: Awaiting handshake"), ue(e, i), s((g) => {
316
- window.removeEventListener(_.Message, y), g && f(g);
316
+ window.addEventListener(_.Message, v), c("Parent: Awaiting handshake"), ue(e, s), i((m) => {
317
+ window.removeEventListener(_.Message, v), m && b(m);
317
318
  });
318
319
  }),
319
320
  destroy() {
@@ -337,23 +338,35 @@ class Q {
337
338
  if (typeof document > "u")
338
339
  return;
339
340
  n && t.searchParams.set("preset", n), this.url = t;
340
- const i = document.createElement("iframe");
341
- 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-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");
342
- const s = document.createElement("div");
343
- s.id = "controller", s.style.position = "fixed", s.style.height = "100%", s.style.width = "100%", s.style.top = "0", s.style.left = "0", s.style.zIndex = "10000", s.style.backgroundColor = "rgba(0,0,0,0.6)", s.style.display = "flex", s.style.alignItems = "center", s.style.justifyContent = "center", s.style.visibility = "hidden", s.style.opacity = "0", s.style.transition = "opacity 0.2s ease", s.appendChild(i), this.iframe = i, this.container = s, we({
341
+ const s = document.createElement("iframe");
342
+ s.src = t.toString(), s.id = e, s.style.border = "none", s.sandbox.add("allow-forms"), s.sandbox.add("allow-popups"), s.sandbox.add("allow-scripts"), s.sandbox.add("allow-same-origin"), s.allow = "publickey-credentials-create *; publickey-credentials-get *; clipboard-write", document.hasStorageAccess && s.sandbox.add("allow-storage-access-by-user-activation");
343
+ const i = document.createElement("div");
344
+ i.id = "controller", i.style.position = "fixed", i.style.height = "100%", i.style.width = "100%", i.style.top = "0", i.style.left = "0", i.style.zIndex = "10000", i.style.backgroundColor = "rgba(0,0,0,0.6)", i.style.display = "flex", i.style.alignItems = "center", i.style.justifyContent = "center", i.style.visibility = "hidden", i.style.opacity = "0", i.style.transition = "opacity 0.2s ease", i.style.pointerEvents = "auto", i.appendChild(s), this.iframe = s, this.container = i, we({
344
345
  iframe: this.iframe,
345
- methods: { close: (p) => () => this.close(), ...c }
346
+ methods: {
347
+ close: (p) => () => this.close(),
348
+ closeAll: (p) => () => {
349
+ document.querySelectorAll(
350
+ 'iframe[id^="controller-"]'
351
+ ).forEach((g) => {
352
+ const f = g.parentElement;
353
+ f && (f.style.visibility = "hidden", f.style.opacity = "0");
354
+ }), document.body.style.overflow = "auto";
355
+ },
356
+ reload: (p) => () => window.location.reload(),
357
+ ...c
358
+ }
346
359
  }).promise.then(a), this.resize(), window.addEventListener("resize", () => this.resize());
347
360
  const l = new MutationObserver(() => {
348
361
  const p = document.getElementById("controller");
349
- document.body && (e === "controller-keychain" && !p || e === "controller-profile") && (document.body.appendChild(s), l.disconnect());
362
+ document.body && (e === "controller-keychain" && !p || e === "controller-profile") && (document.body.appendChild(i), l.disconnect());
350
363
  });
351
364
  l.observe(document.documentElement, {
352
365
  childList: !0,
353
366
  subtree: !0
354
367
  });
355
368
  const d = document.getElementById("controller");
356
- document.body && (e === "controller-keychain" && !d || e === "controller-profile") && document.body.appendChild(s), this.onClose = r;
369
+ document.body && (e === "controller-keychain" && !d || e === "controller-profile") && document.body.appendChild(i), this.onClose = r;
357
370
  }
358
371
  open() {
359
372
  this.container && (document.body.style.overflow = "hidden", this.container.style.visibility = "visible", this.container.style.opacity = "1");
@@ -826,20 +839,20 @@ class xe extends Q {
826
839
  username: r,
827
840
  slot: a,
828
841
  namespace: c,
829
- tokens: i,
830
- policies: s,
842
+ tokens: s,
843
+ policies: i,
831
844
  ...l
832
845
  }) {
833
846
  const d = (e || W).replace(/\/$/, "");
834
847
  let p = new URL(
835
848
  a ? `${d}/account/${r}/slot/${a}` : `${d}/account/${r}`
836
849
  );
837
- if (a && p.searchParams.set("ps", encodeURIComponent(a)), c && p.searchParams.set("ns", encodeURIComponent(c)), n && p.searchParams.set("v", encodeURIComponent(n)), p.searchParams.set("rpcUrl", encodeURIComponent(t)), i?.erc20 && p.searchParams.set(
850
+ if (a && p.searchParams.set("ps", encodeURIComponent(a)), c && p.searchParams.set("ns", encodeURIComponent(c)), n && p.searchParams.set("v", encodeURIComponent(n)), p.searchParams.set("rpcUrl", encodeURIComponent(t)), s?.erc20 && p.searchParams.set(
838
851
  "erc20",
839
- encodeURIComponent(i.erc20.toString())
840
- ), s?.contracts) {
841
- const h = Object.values(s.contracts).flatMap(
842
- (m) => m.methods
852
+ encodeURIComponent(s.erc20.toString())
853
+ ), i?.contracts) {
854
+ const h = Object.values(i.contracts).flatMap(
855
+ (g) => g.methods
843
856
  );
844
857
  p.searchParams.set(
845
858
  "methods",
@@ -874,7 +887,7 @@ class Ne extends H {
874
887
  async probe() {
875
888
  try {
876
889
  if (await this.waitForKeychain(), !this.keychain) {
877
- console.error(new b().message);
890
+ console.error(new u().message);
878
891
  return;
879
892
  }
880
893
  const e = await this.keychain.probe(this.rpcUrl());
@@ -914,7 +927,7 @@ class Ne extends H {
914
927
  if (this.account)
915
928
  return this.account;
916
929
  if (!this.keychain || !this.iframes.keychain) {
917
- console.error(new b().message);
930
+ console.error(new u().message);
918
931
  return;
919
932
  }
920
933
  document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.iframes.keychain.open();
@@ -941,7 +954,7 @@ class Ne extends H {
941
954
  }
942
955
  async switchStarknetChain(e) {
943
956
  if (!this.keychain || !this.iframes.keychain)
944
- return console.error(new b().message), !1;
957
+ return console.error(new u().message), !1;
945
958
  try {
946
959
  if (this.selectedChain = e, (await this.keychain.probe(this.rpcUrl())).rpcUrl === this.rpcUrl())
947
960
  return !0;
@@ -956,7 +969,7 @@ class Ne extends H {
956
969
  }
957
970
  async disconnect() {
958
971
  if (!this.keychain) {
959
- console.error(new b().message);
972
+ console.error(new u().message);
960
973
  return;
961
974
  }
962
975
  return document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.account = void 0, this.keychain.disconnect();
@@ -996,13 +1009,13 @@ class Ne extends H {
996
1009
  }
997
1010
  async openSettings() {
998
1011
  if (!this.keychain || !this.iframes.keychain)
999
- return console.error(new b().message), null;
1012
+ return console.error(new u().message), null;
1000
1013
  this.iframes.profile?.sendBackward ? this.iframes.profile?.sendBackward() : this.iframes.profile?.close(), this.iframes.keychain.open();
1001
1014
  const e = await this.keychain.openSettings();
1002
1015
  return this.iframes.keychain.close(), this.iframes.profile?.sendForward?.(), !(e && e.code === A.NOT_CONNECTED);
1003
1016
  }
1004
1017
  revoke(e, t) {
1005
- return this.keychain ? this.keychain.revoke(e) : (console.error(new b().message), null);
1018
+ return this.keychain ? this.keychain.revoke(e) : (console.error(new u().message), null);
1006
1019
  }
1007
1020
  rpcUrl() {
1008
1021
  const e = this.chains.get(this.selectedChain);
@@ -1018,14 +1031,14 @@ class Ne extends H {
1018
1031
  }
1019
1032
  username() {
1020
1033
  if (!this.keychain) {
1021
- console.error(new b().message);
1034
+ console.error(new u().message);
1022
1035
  return;
1023
1036
  }
1024
1037
  return this.keychain.username();
1025
1038
  }
1026
1039
  openPurchaseCredits() {
1027
1040
  if (!this.keychain || !this.iframes.keychain) {
1028
- console.error(new b().message);
1041
+ console.error(new u().message);
1029
1042
  return;
1030
1043
  }
1031
1044
  if (!this.iframes.profile) {
@@ -1036,7 +1049,7 @@ class Ne extends H {
1036
1049
  }
1037
1050
  openStarterPack() {
1038
1051
  if (!this.keychain || !this.iframes.keychain) {
1039
- console.error(new b().message);
1052
+ console.error(new u().message);
1040
1053
  return;
1041
1054
  }
1042
1055
  if (!this.iframes.profile) {
@@ -1047,7 +1060,7 @@ class Ne extends H {
1047
1060
  }
1048
1061
  async openExecute(e, t) {
1049
1062
  if (!this.keychain || !this.iframes.keychain) {
1050
- console.error(new b().message);
1063
+ console.error(new u().message);
1051
1064
  return;
1052
1065
  }
1053
1066
  if (!this.iframes.profile) {
@@ -1060,7 +1073,7 @@ class Ne extends H {
1060
1073
  return this.iframes.profile?.open(), this.iframes.keychain.close(), this.iframes.profile?.sendForward(), t && this.switchStarknetChain(n), !(r && (r.code === A.NOT_CONNECTED || r.code === A.CANCELED));
1061
1074
  }
1062
1075
  async delegateAccount() {
1063
- return this.keychain ? await this.keychain.delegateAccount() : (console.error(new b().message), null);
1076
+ return this.keychain ? await this.keychain.delegateAccount() : (console.error(new u().message), null);
1064
1077
  }
1065
1078
  async validateChains(e) {
1066
1079
  for (const t of e)
@@ -1089,7 +1102,7 @@ class Ne extends H {
1089
1102
  });
1090
1103
  }
1091
1104
  }
1092
- const R = /* @__PURE__ */ new Map();
1105
+ const S = /* @__PURE__ */ new Map();
1093
1106
  async function F(o) {
1094
1107
  if (!o.addresses?.length && !o.usernames?.length)
1095
1108
  return { results: [] };
@@ -1105,22 +1118,22 @@ async function F(o) {
1105
1118
  return e.json();
1106
1119
  }
1107
1120
  async function je(o) {
1108
- const e = o.filter((t) => !R.has(t));
1121
+ const e = o.filter((t) => !S.has(t));
1109
1122
  return e.length > 0 && (await F({ usernames: e })).results.forEach((n) => {
1110
- R.set(n.username, n.addresses[0]);
1123
+ S.set(n.username, n.addresses[0]);
1111
1124
  }), new Map(
1112
- o.map((t) => [t, R.get(t)]).filter((t) => t[1] !== void 0)
1125
+ o.map((t) => [t, S.get(t)]).filter((t) => t[1] !== void 0)
1113
1126
  );
1114
1127
  }
1115
1128
  async function Be(o) {
1116
1129
  o = o.map(O.toHex);
1117
- const e = o.filter((t) => !R.has(t));
1130
+ const e = o.filter((t) => !S.has(t));
1118
1131
  return e.length > 0 && (await F({
1119
1132
  addresses: e
1120
1133
  })).results.forEach((n) => {
1121
- R.set(n.addresses[0], n.username);
1134
+ S.set(n.addresses[0], n.username);
1122
1135
  }), new Map(
1123
- o.map((t) => [t, R.get(t)]).filter((t) => t[1] !== void 0)
1136
+ o.map((t) => [t, S.get(t)]).filter((t) => t[1] !== void 0)
1124
1137
  );
1125
1138
  }
1126
1139
  var U = {
@@ -3802,7 +3815,7 @@ var U = {
3802
3815
  }
3803
3816
  }
3804
3817
  }
3805
- }, Re = [
3818
+ }, Se = [
3806
3819
  {
3807
3820
  name: "Wrapped BTC",
3808
3821
  symbol: "WBTC",
@@ -4348,11 +4361,12 @@ var U = {
4348
4361
  hidden: !0,
4349
4362
  logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/6deef27f-df40-4248-4e1b-ed1d79a3f000/logo"
4350
4363
  }
4351
- ], Te = U, Qe = Re, Fe = U.cartridge.theme;
4364
+ ], Te = U, Qe = Se, Fe = U.cartridge.theme;
4352
4365
  export {
4353
4366
  Ae as ArgentWallet,
4367
+ Oe as FeeSource,
4354
4368
  _e as MetaMaskWallet,
4355
- b as NotReadyToConnect,
4369
+ u as NotReadyToConnect,
4356
4370
  ke as PhantomWallet,
4357
4371
  A as ResponseCodes,
4358
4372
  Ce as WalletBridge,
@@ -4360,13 +4374,13 @@ export {
4360
4374
  Ne as default,
4361
4375
  Fe as defaultTheme,
4362
4376
  Qe as erc20Metadata,
4363
- Oe as humanizeString,
4377
+ Ye as humanizeString,
4364
4378
  Be as lookupAddresses,
4365
4379
  je as lookupUsernames,
4366
- Ye as normalizeCalls,
4380
+ $e as normalizeCalls,
4367
4381
  K as parseChainId,
4368
4382
  Y as toArray,
4369
- $e as toSessionPolicies,
4370
- We as toWasmPolicies
4383
+ We as toSessionPolicies,
4384
+ He as toWasmPolicies
4371
4385
  };
4372
4386
  //# sourceMappingURL=index.js.map