@cartridge/controller 0.7.13 → 0.7.14-alpha.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/.turbo/turbo-build$colon$deps.log +13 -13
- package/.turbo/turbo-build.log +12 -12
- package/dist/index.js +13 -12
- package/dist/index.js.map +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/{provider-C4iZV8Y5.js → provider-DAt9mAeP.js} +2 -2
- package/dist/{provider-C4iZV8Y5.js.map → provider-DAt9mAeP.js.map} +1 -1
- package/dist/session.js +2 -2
- package/dist/stats.html +1 -1
- package/package.json +4 -4
- package/src/controller.ts +2 -2
- package/src/iframe/base.ts +10 -5
- package/src/wallets/metamask/index.ts +1 -1
- package/src/wallets/rabby/index.ts +1 -1
- package/src/wallets/wallet-connect/index.ts +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
> @cartridge/controller@0.7.
|
|
2
|
+
> @cartridge/controller@0.7.14-alpha.0 build:deps /home/runner/work/controller/controller/packages/controller
|
|
3
3
|
> pnpm build
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @cartridge/controller@0.7.
|
|
6
|
+
> @cartridge/controller@0.7.14-alpha.0 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
|
+
> @cartridge/controller@0.7.14-alpha.0 build:browser /home/runner/work/controller/controller/packages/controller
|
|
11
11
|
> vite build
|
|
12
12
|
|
|
13
13
|
[36mvite v6.3.4 [32mbuilding for production...[36m[39m
|
|
@@ -19,13 +19,13 @@ rendering chunks...
|
|
|
19
19
|
[vite:dts] Start generate declaration files...
|
|
20
20
|
computing gzip size...
|
|
21
21
|
[2mdist/[22m[36msession.js [39m[1m[2m 11.10 kB[22m[1m[22m[2m │ gzip: 3.45 kB[22m[2m │ map: 59.54 kB[22m
|
|
22
|
-
[2mdist/[22m[36mprovider-
|
|
23
|
-
[2mdist/[22m[36mindex.js [39m[1m[2m201.
|
|
24
|
-
[vite:dts] Declaration files built in
|
|
22
|
+
[2mdist/[22m[36mprovider-DAt9mAeP.js [39m[1m[2m 12.78 kB[22m[1m[22m[2m │ gzip: 5.24 kB[22m[2m │ map: 30.48 kB[22m
|
|
23
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m201.33 kB[22m[1m[22m[2m │ gzip: 34.35 kB[22m[2m │ map: 428.49 kB[22m
|
|
24
|
+
[vite:dts] Declaration files built in 5104ms.
|
|
25
25
|
|
|
26
|
-
[32m✓ built in 6.
|
|
26
|
+
[32m✓ built in 6.81s[39m
|
|
27
27
|
|
|
28
|
-
> @cartridge/controller@0.7.
|
|
28
|
+
> @cartridge/controller@0.7.14-alpha.0 build:node /home/runner/work/controller/controller/packages/controller
|
|
29
29
|
> tsup --config tsup.node.config.ts
|
|
30
30
|
|
|
31
31
|
[34mCLI[39m Building entry: src/node/index.ts
|
|
@@ -39,13 +39,13 @@ computing gzip size...
|
|
|
39
39
|
"constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
|
|
40
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.
|
|
41
41
|
"constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
|
|
42
|
-
[32mCJS[39m [1mdist/node/index.cjs [22m[32m21.
|
|
43
|
-
[32mCJS[39m [1mdist/node/index.cjs.map [22m[32m49.
|
|
44
|
-
[32mCJS[39m ⚡️ Build success in
|
|
42
|
+
[32mCJS[39m [1mdist/node/index.cjs [22m[32m21.89 KB[39m
|
|
43
|
+
[32mCJS[39m [1mdist/node/index.cjs.map [22m[32m49.25 KB[39m
|
|
44
|
+
[32mCJS[39m ⚡️ Build success in 355ms
|
|
45
45
|
[32mESM[39m [1mdist/node/index.js [22m[32m21.12 KB[39m
|
|
46
46
|
[32mESM[39m [1mdist/node/index.js.map [22m[32m49.04 KB[39m
|
|
47
|
-
[32mESM[39m ⚡️ Build success in
|
|
47
|
+
[32mESM[39m ⚡️ Build success in 356ms
|
|
48
48
|
[34mDTS[39m Build start
|
|
49
|
-
[32mDTS[39m ⚡️ Build success in
|
|
49
|
+
[32mDTS[39m ⚡️ Build success in 4235ms
|
|
50
50
|
[32mDTS[39m [1mdist/node/index.d.ts [22m[32m5.29 KB[39m
|
|
51
51
|
[32mDTS[39m [1mdist/node/index.d.cts [22m[32m5.29 KB[39m
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @cartridge/controller@0.7.
|
|
2
|
+
> @cartridge/controller@0.7.14-alpha.0 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.
|
|
6
|
+
> @cartridge/controller@0.7.14-alpha.0 build:browser /home/runner/work/controller/controller/packages/controller
|
|
7
7
|
> vite build
|
|
8
8
|
|
|
9
9
|
[36mvite v6.3.4 [32mbuilding for production...[36m[39m
|
|
@@ -15,13 +15,13 @@ rendering chunks...
|
|
|
15
15
|
[vite:dts] Start generate declaration files...
|
|
16
16
|
computing gzip size...
|
|
17
17
|
[2mdist/[22m[36msession.js [39m[1m[2m 11.10 kB[22m[1m[22m[2m │ gzip: 3.45 kB[22m[2m │ map: 59.54 kB[22m
|
|
18
|
-
[2mdist/[22m[36mprovider-
|
|
19
|
-
[2mdist/[22m[36mindex.js [39m[1m[2m201.
|
|
20
|
-
[vite:dts] Declaration files built in
|
|
18
|
+
[2mdist/[22m[36mprovider-DAt9mAeP.js [39m[1m[2m 12.78 kB[22m[1m[22m[2m │ gzip: 5.24 kB[22m[2m │ map: 30.48 kB[22m
|
|
19
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m201.33 kB[22m[1m[22m[2m │ gzip: 34.35 kB[22m[2m │ map: 428.49 kB[22m
|
|
20
|
+
[vite:dts] Declaration files built in 5123ms.
|
|
21
21
|
|
|
22
|
-
[32m✓ built in
|
|
22
|
+
[32m✓ built in 7.05s[39m
|
|
23
23
|
|
|
24
|
-
> @cartridge/controller@0.7.
|
|
24
|
+
> @cartridge/controller@0.7.14-alpha.0 build:node /home/runner/work/controller/controller/packages/controller
|
|
25
25
|
> tsup --config tsup.node.config.ts
|
|
26
26
|
|
|
27
27
|
[34mCLI[39m Building entry: src/node/index.ts
|
|
@@ -35,13 +35,13 @@ computing gzip size...
|
|
|
35
35
|
"constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
|
|
36
36
|
"constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
|
|
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
|
-
[32mCJS[39m [1mdist/node/index.cjs [22m[32m21.88 KB[39m
|
|
39
|
-
[32mCJS[39m [1mdist/node/index.cjs.map [22m[32m49.24 KB[39m
|
|
40
|
-
[32mCJS[39m ⚡️ Build success in 294ms
|
|
41
38
|
[32mESM[39m [1mdist/node/index.js [22m[32m21.12 KB[39m
|
|
42
39
|
[32mESM[39m [1mdist/node/index.js.map [22m[32m49.04 KB[39m
|
|
43
|
-
[32mESM[39m ⚡️ Build success in
|
|
40
|
+
[32mESM[39m ⚡️ Build success in 332ms
|
|
41
|
+
[32mCJS[39m [1mdist/node/index.cjs [22m[32m21.89 KB[39m
|
|
42
|
+
[32mCJS[39m [1mdist/node/index.cjs.map [22m[32m49.25 KB[39m
|
|
43
|
+
[32mCJS[39m ⚡️ Build success in 331ms
|
|
44
44
|
[34mDTS[39m Build start
|
|
45
|
-
[32mDTS[39m ⚡️ Build success in
|
|
45
|
+
[32mDTS[39m ⚡️ Build success in 4248ms
|
|
46
46
|
[32mDTS[39m [1mdist/node/index.d.ts [22m[32m5.29 KB[39m
|
|
47
47
|
[32mDTS[39m [1mdist/node/index.d.cts [22m[32m5.29 KB[39m
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WalletAccount as Pe, shortString as G, num as Me } from "starknet";
|
|
2
|
-
import { R as E, t as Ne, K as De, P as Be, B as ze, N as y, p as Te, A as je } from "./provider-
|
|
3
|
-
import { F as fn, h as bn, n as yn, a as wn, b as vn } from "./provider-
|
|
2
|
+
import { R as E, t as Ne, K as De, P as Be, B as ze, N as y, p as Te, A as je } from "./provider-DAt9mAeP.js";
|
|
3
|
+
import { F as fn, h as bn, n as yn, a as wn, b as vn } from "./provider-DAt9mAeP.js";
|
|
4
4
|
import { connect as Ue } from "starknetkit";
|
|
5
5
|
import { InjectedConnector as Le } from "starknetkit/injected";
|
|
6
6
|
import { MetaMaskSDK as Oe } from "@metamask/sdk";
|
|
@@ -335,7 +335,7 @@ class be {
|
|
|
335
335
|
onConnect: a,
|
|
336
336
|
methods: i = {}
|
|
337
337
|
}) {
|
|
338
|
-
if (typeof document > "u")
|
|
338
|
+
if (typeof document > "u" || typeof window > "u")
|
|
339
339
|
return;
|
|
340
340
|
r && t.searchParams.set("preset", r), this.url = t;
|
|
341
341
|
const s = document.createElement("iframe");
|
|
@@ -351,13 +351,14 @@ class be {
|
|
|
351
351
|
).forEach((m) => {
|
|
352
352
|
const f = m.parentElement;
|
|
353
353
|
f && (f.style.visibility = "hidden", f.style.opacity = "0");
|
|
354
|
-
}), document.body.style.overflow = "auto";
|
|
354
|
+
}), document.body && (document.body.style.overflow = "auto");
|
|
355
355
|
},
|
|
356
356
|
reload: (l) => () => window.location.reload(),
|
|
357
357
|
...i
|
|
358
358
|
}
|
|
359
359
|
}).promise.then(a), this.resize(), window.addEventListener("resize", () => this.resize());
|
|
360
360
|
const p = new MutationObserver(() => {
|
|
361
|
+
if (typeof document > "u") return;
|
|
361
362
|
const l = document.getElementById("controller");
|
|
362
363
|
document.body && (e === "controller-keychain" && !l || e === "controller-profile") && (document.body.appendChild(d), p.disconnect());
|
|
363
364
|
});
|
|
@@ -369,10 +370,10 @@ class be {
|
|
|
369
370
|
document.body && (e === "controller-keychain" && !c || e === "controller-profile") && document.body.appendChild(d), this.onClose = o;
|
|
370
371
|
}
|
|
371
372
|
open() {
|
|
372
|
-
this.container
|
|
373
|
+
!this.container || typeof document > "u" || !document.body || (document.body.style.overflow = "hidden", this.container.style.visibility = "visible", this.container.style.opacity = "1");
|
|
373
374
|
}
|
|
374
375
|
close() {
|
|
375
|
-
this.container
|
|
376
|
+
!this.container || typeof document > "u" || !document.body || (this.onClose?.(), document.body.style.overflow = "auto", this.container.style.visibility = "hidden", this.container.style.opacity = "0");
|
|
376
377
|
}
|
|
377
378
|
sendBackward() {
|
|
378
379
|
this.container && (this.container.style.zIndex = "9999");
|
|
@@ -381,7 +382,7 @@ class be {
|
|
|
381
382
|
this.container && (this.container.style.zIndex = "10000");
|
|
382
383
|
}
|
|
383
384
|
resize() {
|
|
384
|
-
if (this.iframe) {
|
|
385
|
+
if (!(!this.iframe || typeof window > "u")) {
|
|
385
386
|
if (this.iframe.style.userSelect = "none", window.innerWidth < 768) {
|
|
386
387
|
this.iframe.style.height = "100%", this.iframe.style.width = "100%", this.iframe.style.borderRadius = "0";
|
|
387
388
|
return;
|
|
@@ -528,7 +529,7 @@ class gt {
|
|
|
528
529
|
this.MMSDK = new Oe({
|
|
529
530
|
dappMetadata: {
|
|
530
531
|
name: "Cartridge Controller",
|
|
531
|
-
url: window.location.href
|
|
532
|
+
url: typeof window < "u" ? window.location.href : ""
|
|
532
533
|
}
|
|
533
534
|
}), this.isAvailable() && this.MMSDK.sdkInitPromise?.then(() => {
|
|
534
535
|
this.MMSDK.getProvider()?.request({
|
|
@@ -811,7 +812,7 @@ class ut {
|
|
|
811
812
|
});
|
|
812
813
|
}
|
|
813
814
|
isAvailable() {
|
|
814
|
-
return !!this.provider;
|
|
815
|
+
return typeof window < "u" && !!this.provider;
|
|
815
816
|
}
|
|
816
817
|
getInfo() {
|
|
817
818
|
const e = this.isAvailable();
|
|
@@ -1218,7 +1219,7 @@ class an extends ze {
|
|
|
1218
1219
|
console.error(new y().message);
|
|
1219
1220
|
return;
|
|
1220
1221
|
}
|
|
1221
|
-
document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.iframes.keychain.open();
|
|
1222
|
+
typeof document < "u" && document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.iframes.keychain.open();
|
|
1222
1223
|
try {
|
|
1223
1224
|
let e = await this.keychain.connect(
|
|
1224
1225
|
this.options.policies || {},
|
|
@@ -1260,7 +1261,7 @@ class an extends ze {
|
|
|
1260
1261
|
console.error(new y().message);
|
|
1261
1262
|
return;
|
|
1262
1263
|
}
|
|
1263
|
-
return document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.account = void 0, this.keychain.disconnect();
|
|
1264
|
+
return typeof document < "u" && document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.account = void 0, this.keychain.disconnect();
|
|
1264
1265
|
}
|
|
1265
1266
|
async openProfile(e = "inventory") {
|
|
1266
1267
|
if (!this.profile || !this.iframes.profile?.url) {
|
|
@@ -2212,7 +2213,7 @@ class pn {
|
|
|
2212
2213
|
return this.account ? [this.account] : [];
|
|
2213
2214
|
}
|
|
2214
2215
|
isAvailable() {
|
|
2215
|
-
return !!this.provider;
|
|
2216
|
+
return typeof window < "u" && !!this.provider;
|
|
2216
2217
|
}
|
|
2217
2218
|
getInfo() {
|
|
2218
2219
|
const e = this.isAvailable();
|