@cartridge/controller 0.7.13 → 0.7.14-alpha.1
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 +14 -14
- package/.turbo/turbo-build.log +13 -13
- package/dist/index.js +15 -13
- 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-CwuOc9_a.js} +2 -2
- package/dist/{provider-C4iZV8Y5.js.map → provider-CwuOc9_a.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/bridge.ts +5 -3
- 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.1 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.1 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.1 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-CwuOc9_a.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.32 kB[22m[1m[22m[2m │ gzip: 34.36 kB[22m[2m │ map: 428.46 kB[22m
|
|
24
|
+
[vite:dts] Declaration files built in 5253ms.
|
|
25
25
|
|
|
26
|
-
[32m✓ built in 6.
|
|
26
|
+
[32m✓ built in 6.92s[39m
|
|
27
27
|
|
|
28
|
-
> @cartridge/controller@0.7.
|
|
28
|
+
> @cartridge/controller@0.7.14-alpha.1 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
|
|
@@ -36,16 +36,16 @@ computing gzip size...
|
|
|
36
36
|
[34mCLI[39m Cleaning output folder
|
|
37
37
|
[34mESM[39m Build start
|
|
38
38
|
[34mCJS[39m Build start
|
|
39
|
+
"constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
|
|
39
40
|
"constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
|
|
40
41
|
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
|
-
"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.88 KB[39m
|
|
43
|
-
[32mCJS[39m [1mdist/node/index.cjs.map [22m[32m49.24 KB[39m
|
|
44
|
-
[32mCJS[39m ⚡️ Build success in 377ms
|
|
45
42
|
[32mESM[39m [1mdist/node/index.js [22m[32m21.12 KB[39m
|
|
46
43
|
[32mESM[39m [1mdist/node/index.js.map [22m[32m49.04 KB[39m
|
|
47
|
-
[32mESM[39m ⚡️ Build success in
|
|
44
|
+
[32mESM[39m ⚡️ Build success in 346ms
|
|
45
|
+
[32mCJS[39m [1mdist/node/index.cjs [22m[32m21.89 KB[39m
|
|
46
|
+
[32mCJS[39m [1mdist/node/index.cjs.map [22m[32m49.25 KB[39m
|
|
47
|
+
[32mCJS[39m ⚡️ Build success in 346ms
|
|
48
48
|
[34mDTS[39m Build start
|
|
49
|
-
[32mDTS[39m ⚡️ Build success in
|
|
49
|
+
[32mDTS[39m ⚡️ Build success in 4292ms
|
|
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.1 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.1 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-CwuOc9_a.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.32 kB[22m[1m[22m[2m │ gzip: 34.36 kB[22m[2m │ map: 428.46 kB[22m
|
|
20
|
+
[vite:dts] Declaration files built in 5111ms.
|
|
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.1 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
|
|
@@ -32,16 +32,16 @@ computing gzip size...
|
|
|
32
32
|
[34mCLI[39m Cleaning output folder
|
|
33
33
|
[34mESM[39m Build start
|
|
34
34
|
[34mCJS[39m Build start
|
|
35
|
-
"constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
|
|
36
35
|
"constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
|
|
37
36
|
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
|
-
|
|
39
|
-
[32mCJS[39m [1mdist/node/index.cjs
|
|
40
|
-
[32mCJS[39m
|
|
37
|
+
"constants", "getChecksumAddress", "Provider" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
|
|
38
|
+
[32mCJS[39m [1mdist/node/index.cjs [22m[32m21.89 KB[39m
|
|
39
|
+
[32mCJS[39m [1mdist/node/index.cjs.map [22m[32m49.25 KB[39m
|
|
40
|
+
[32mCJS[39m ⚡️ Build success in 278ms
|
|
41
41
|
[32mESM[39m [1mdist/node/index.js [22m[32m21.12 KB[39m
|
|
42
42
|
[32mESM[39m [1mdist/node/index.js.map [22m[32m49.04 KB[39m
|
|
43
|
-
[32mESM[39m ⚡️ Build success in
|
|
43
|
+
[32mESM[39m ⚡️ Build success in 278ms
|
|
44
44
|
[34mDTS[39m Build start
|
|
45
|
-
[32mDTS[39m ⚡️ Build success in
|
|
45
|
+
[32mDTS[39m ⚡️ Build success in 4487ms
|
|
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-CwuOc9_a.js";
|
|
3
|
+
import { F as fn, h as bn, n as yn, a as wn, b as vn } from "./provider-CwuOc9_a.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;
|
|
@@ -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();
|
|
@@ -963,7 +964,8 @@ class ut {
|
|
|
963
964
|
class ft {
|
|
964
965
|
walletAdapters;
|
|
965
966
|
constructor() {
|
|
966
|
-
this.walletAdapters = /* @__PURE__ */ new Map()
|
|
967
|
+
if (this.walletAdapters = /* @__PURE__ */ new Map(), typeof window > "u")
|
|
968
|
+
return;
|
|
967
969
|
const e = new gt();
|
|
968
970
|
e.isAvailable() && this.walletAdapters.set("metamask", e);
|
|
969
971
|
const t = new mt();
|
|
@@ -971,7 +973,7 @@ class ft {
|
|
|
971
973
|
const r = new pt();
|
|
972
974
|
r.isAvailable() && this.walletAdapters.set("argent", r);
|
|
973
975
|
const o = new ut();
|
|
974
|
-
o.isAvailable() && this.walletAdapters.set("rabby", o),
|
|
976
|
+
o.isAvailable() && this.walletAdapters.set("rabby", o), window.wallet_bridge = this;
|
|
975
977
|
}
|
|
976
978
|
getIFrameMethods() {
|
|
977
979
|
return {
|
|
@@ -1218,7 +1220,7 @@ class an extends ze {
|
|
|
1218
1220
|
console.error(new y().message);
|
|
1219
1221
|
return;
|
|
1220
1222
|
}
|
|
1221
|
-
document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.iframes.keychain.open();
|
|
1223
|
+
typeof document < "u" && document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.iframes.keychain.open();
|
|
1222
1224
|
try {
|
|
1223
1225
|
let e = await this.keychain.connect(
|
|
1224
1226
|
this.options.policies || {},
|
|
@@ -1260,7 +1262,7 @@ class an extends ze {
|
|
|
1260
1262
|
console.error(new y().message);
|
|
1261
1263
|
return;
|
|
1262
1264
|
}
|
|
1263
|
-
return document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.account = void 0, this.keychain.disconnect();
|
|
1265
|
+
return typeof document < "u" && document.hasStorageAccess && (await document.hasStorageAccess() || await document.requestStorageAccess()), this.account = void 0, this.keychain.disconnect();
|
|
1264
1266
|
}
|
|
1265
1267
|
async openProfile(e = "inventory") {
|
|
1266
1268
|
if (!this.profile || !this.iframes.profile?.url) {
|
|
@@ -2212,7 +2214,7 @@ class pn {
|
|
|
2212
2214
|
return this.account ? [this.account] : [];
|
|
2213
2215
|
}
|
|
2214
2216
|
isAvailable() {
|
|
2215
|
-
return !!this.provider;
|
|
2217
|
+
return typeof window < "u" && !!this.provider;
|
|
2216
2218
|
}
|
|
2217
2219
|
getInfo() {
|
|
2218
2220
|
const e = this.isAvailable();
|