@cartridge/controller 0.7.10 → 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.10 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.10 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.10 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.36 kB │ map: 56.40 kB
22
- dist/provider-Dr912mPw.js  23.20 kB │ gzip: 13.54 kB │ map: 40.69 kB
23
- dist/index.js 135.80 kB │ gzip: 24.34 kB │ map: 258.51 kB
24
- [vite:dts] Declaration files built in 3451ms.
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.21s
26
+ ✓ built in 4.17s
27
27
 
28
- > @cartridge/controller@0.7.10 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
@@ -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", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
40
39
  "constants", "getChecksumAddress", "Provider" 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 31.14 KB
43
- ESM dist/node/index.js.map 58.58 KB
44
- ESM ⚡️ Build success in 395ms
41
+ "constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
45
42
  CJS dist/node/index.cjs 31.90 KB
46
43
  CJS dist/node/index.cjs.map 58.78 KB
47
- CJS ⚡️ Build success in 395ms
44
+ CJS ⚡️ Build success in 389ms
45
+ ESM dist/node/index.js 31.14 KB
46
+ ESM dist/node/index.js.map 58.58 KB
47
+ ESM ⚡️ Build success in 389ms
48
48
  DTS Build start
49
- DTS ⚡️ Build success in 3035ms
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.10 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.10 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.36 kB │ map: 56.40 kB
18
- dist/provider-Dr912mPw.js  23.20 kB │ gzip: 13.54 kB │ map: 40.69 kB
19
- dist/index.js 135.80 kB │ gzip: 24.34 kB │ map: 258.51 kB
20
- [vite:dts] Declaration files built in 3300ms.
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.20s
22
+ ✓ built in 4.32s
23
23
 
24
- > @cartridge/controller@0.7.10 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
@@ -37,11 +37,11 @@ computing gzip size...
37
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.
38
38
  ESM dist/node/index.js 31.14 KB
39
39
  ESM dist/node/index.js.map 58.58 KB
40
- ESM ⚡️ Build success in 289ms
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 293ms
43
+ CJS ⚡️ Build success in 325ms
44
44
  DTS Build start
45
- DTS ⚡️ Build success in 3297ms
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 u, p as K, A as q } from "./provider-Dr912mPw.js";
3
- import { h as Oe, n as Ye, a as $e, b as We } from "./provider-Dr912mPw.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);
@@ -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,19 +132,19 @@ 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
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
144
  const p = d.data, { methodName: h, args: g, id: f } = p;
144
145
  t(`${n}: Received ${h}() call`);
145
146
  const w = (b) => (k) => {
146
- if (t(`${n}: Sending ${h}() reply`), s) {
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
  }
@@ -173,7 +174,7 @@ const Z = (o, e) => {
173
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,14 +196,14 @@ 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
202
  const p = (g) => (...f) => {
202
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
  }
@@ -212,16 +213,16 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
212
213
  }
213
214
  return new Promise((b, k) => {
214
215
  const v = ce(), m = (x) => {
215
- if (x.source !== i || x.data.penpal !== y.Reply || x.data.id !== v)
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 S = x.data;
222
+ const R = x.data;
222
223
  r(`${a}: Received ${g}() reply`), c.removeEventListener(_.Message, m);
223
- let P = S.returnValue;
224
- S.returnValueIsError && (P = ae(P)), (S.resolution === C.Fulfilled ? b : k)(P);
224
+ let P = R.returnValue;
225
+ R.returnValueIsError && (P = ae(P)), (R.resolution === C.Fulfilled ? b : k)(P);
225
226
  };
226
227
  c.addEventListener(_.Message, m);
227
228
  const I = {
@@ -230,7 +231,7 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
230
231
  methodName: g,
231
232
  args: f
232
233
  };
233
- i.postMessage(I, s);
234
+ s.postMessage(I, i);
234
235
  });
235
236
  }, h = t.reduce((g, f) => (g[f] = p(f), g), {});
236
237
  return Object.assign(o, ge(h)), () => {
@@ -238,7 +239,7 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
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((g) => {
257
+ s && s(), s = ie(p, o, r), c(s), i && i.forEach((g) => {
257
258
  delete l[g];
258
- }), s = d.data.methodNames;
259
- const h = me(l, p, s, a, r);
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) => {
@@ -294,9 +295,9 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
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), g = 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
302
  promise: new Promise((w, b) => {
302
303
  const k = ye(r, l), v = (m) => {
@@ -312,7 +313,7 @@ const ce = () => ++se, j = ".", B = (o) => o ? o.split(j) : [], de = (o) => o.jo
312
313
  }
313
314
  }
314
315
  };
315
- window.addEventListener(_.Message, v), c("Parent: Awaiting handshake"), ue(e, i), s((m) => {
316
+ window.addEventListener(_.Message, v), c("Parent: Awaiting handshake"), ue(e, s), i((m) => {
316
317
  window.removeEventListener(_.Message, v), m && b(m);
317
318
  });
318
319
  }),
@@ -337,10 +338,10 @@ 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
346
  methods: {
346
347
  close: (p) => () => this.close(),
@@ -358,14 +359,14 @@ class Q {
358
359
  }).promise.then(a), this.resize(), window.addEventListener("resize", () => this.resize());
359
360
  const l = new MutationObserver(() => {
360
361
  const p = document.getElementById("controller");
361
- 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());
362
363
  });
363
364
  l.observe(document.documentElement, {
364
365
  childList: !0,
365
366
  subtree: !0
366
367
  });
367
368
  const d = document.getElementById("controller");
368
- 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;
369
370
  }
370
371
  open() {
371
372
  this.container && (document.body.style.overflow = "hidden", this.container.style.visibility = "visible", this.container.style.opacity = "1");
@@ -838,19 +839,19 @@ class xe extends Q {
838
839
  username: r,
839
840
  slot: a,
840
841
  namespace: c,
841
- tokens: i,
842
- policies: s,
842
+ tokens: s,
843
+ policies: i,
843
844
  ...l
844
845
  }) {
845
846
  const d = (e || W).replace(/\/$/, "");
846
847
  let p = new URL(
847
848
  a ? `${d}/account/${r}/slot/${a}` : `${d}/account/${r}`
848
849
  );
849
- 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(
850
851
  "erc20",
851
- encodeURIComponent(i.erc20.toString())
852
- ), s?.contracts) {
853
- const h = Object.values(s.contracts).flatMap(
852
+ encodeURIComponent(s.erc20.toString())
853
+ ), i?.contracts) {
854
+ const h = Object.values(i.contracts).flatMap(
854
855
  (g) => g.methods
855
856
  );
856
857
  p.searchParams.set(
@@ -1101,7 +1102,7 @@ class Ne extends H {
1101
1102
  });
1102
1103
  }
1103
1104
  }
1104
- const R = /* @__PURE__ */ new Map();
1105
+ const S = /* @__PURE__ */ new Map();
1105
1106
  async function F(o) {
1106
1107
  if (!o.addresses?.length && !o.usernames?.length)
1107
1108
  return { results: [] };
@@ -1117,22 +1118,22 @@ async function F(o) {
1117
1118
  return e.json();
1118
1119
  }
1119
1120
  async function je(o) {
1120
- const e = o.filter((t) => !R.has(t));
1121
+ const e = o.filter((t) => !S.has(t));
1121
1122
  return e.length > 0 && (await F({ usernames: e })).results.forEach((n) => {
1122
- R.set(n.username, n.addresses[0]);
1123
+ S.set(n.username, n.addresses[0]);
1123
1124
  }), new Map(
1124
- 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)
1125
1126
  );
1126
1127
  }
1127
1128
  async function Be(o) {
1128
1129
  o = o.map(O.toHex);
1129
- const e = o.filter((t) => !R.has(t));
1130
+ const e = o.filter((t) => !S.has(t));
1130
1131
  return e.length > 0 && (await F({
1131
1132
  addresses: e
1132
1133
  })).results.forEach((n) => {
1133
- R.set(n.addresses[0], n.username);
1134
+ S.set(n.addresses[0], n.username);
1134
1135
  }), new Map(
1135
- 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)
1136
1137
  );
1137
1138
  }
1138
1139
  var U = {
@@ -3814,7 +3815,7 @@ var U = {
3814
3815
  }
3815
3816
  }
3816
3817
  }
3817
- }, Re = [
3818
+ }, Se = [
3818
3819
  {
3819
3820
  name: "Wrapped BTC",
3820
3821
  symbol: "WBTC",
@@ -4360,9 +4361,10 @@ var U = {
4360
4361
  hidden: !0,
4361
4362
  logo_url: "https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/6deef27f-df40-4248-4e1b-ed1d79a3f000/logo"
4362
4363
  }
4363
- ], Te = U, Qe = Re, Fe = U.cartridge.theme;
4364
+ ], Te = U, Qe = Se, Fe = U.cartridge.theme;
4364
4365
  export {
4365
4366
  Ae as ArgentWallet,
4367
+ Oe as FeeSource,
4366
4368
  _e as MetaMaskWallet,
4367
4369
  u as NotReadyToConnect,
4368
4370
  ke as PhantomWallet,
@@ -4372,13 +4374,13 @@ export {
4372
4374
  Ne as default,
4373
4375
  Fe as defaultTheme,
4374
4376
  Qe as erc20Metadata,
4375
- Oe as humanizeString,
4377
+ Ye as humanizeString,
4376
4378
  Be as lookupAddresses,
4377
4379
  je as lookupUsernames,
4378
- Ye as normalizeCalls,
4380
+ $e as normalizeCalls,
4379
4381
  K as parseChainId,
4380
4382
  Y as toArray,
4381
- $e as toSessionPolicies,
4382
- We as toWasmPolicies
4383
+ We as toSessionPolicies,
4384
+ He as toWasmPolicies
4383
4385
  };
4384
4386
  //# sourceMappingURL=index.js.map