@cartridge/controller 0.11.1 → 0.11.2-alpha.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.11.1 build:deps /home/runner/work/controller/controller/packages/controller
2
+ > @cartridge/controller@0.11.2-alpha.2 build:deps /home/runner/work/controller/controller/packages/controller
3
3
  > pnpm build
4
4
 
5
5
 
6
- > @cartridge/controller@0.11.1 build /home/runner/work/controller/controller/packages/controller
6
+ > @cartridge/controller@0.11.2-alpha.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.11.1 build:browser /home/runner/work/controller/controller/packages/controller
10
+ > @cartridge/controller@0.11.2-alpha.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...
@@ -18,13 +18,13 @@ rendering chunks...
18
18
  [vite:dts] Start generate declaration files...
19
19
  computing gzip size...
20
20
  dist/session.js  8.75 kB │ gzip: 2.69 kB │ map: 20.54 kB
21
- dist/provider-GfOahKeA.js  13.95 kB │ gzip: 5.76 kB │ map: 36.06 kB
22
- dist/index.js 140.99 kB │ gzip: 35.90 kB │ map: 452.82 kB
23
- [vite:dts] Declaration files built in 4496ms.
21
+ dist/provider-DHDBdWz-.js  13.96 kB │ gzip: 5.77 kB │ map: 36.24 kB
22
+ dist/index.js 141.56 kB │ gzip: 36.01 kB │ map: 454.77 kB
23
+ [vite:dts] Declaration files built in 4500ms.
24
24
 
25
- ✓ built in 6.24s
25
+ ✓ built in 6.30s
26
26
 
27
- > @cartridge/controller@0.11.1 build:node /home/runner/work/controller/controller/packages/controller
27
+ > @cartridge/controller@0.11.2-alpha.2 build:node /home/runner/work/controller/controller/packages/controller
28
28
  > tsup --config tsup.node.config.ts
29
29
 
30
30
  CLI Building entry: src/node/index.ts
@@ -38,13 +38,13 @@ computing gzip size...
38
38
  "constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
39
39
  "constants", "getChecksumAddress" 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
- ESM dist/node/index.js 21.53 KB
41
+ ESM dist/node/index.js 21.54 KB
42
42
  ESM dist/node/index.js.map 51.13 KB
43
- ESM ⚡️ Build success in 402ms
44
- CJS dist/node/index.cjs 22.32 KB
45
- CJS dist/node/index.cjs.map 51.36 KB
46
- CJS ⚡️ Build success in 403ms
43
+ ESM ⚡️ Build success in 392ms
44
+ CJS dist/node/index.cjs 22.33 KB
45
+ CJS dist/node/index.cjs.map 51.37 KB
46
+ CJS ⚡️ Build success in 392ms
47
47
  DTS Build start
48
- DTS ⚡️ Build success in 3968ms
48
+ DTS ⚡️ Build success in 4032ms
49
49
  DTS dist/node/index.d.ts 5.94 KB
50
50
  DTS dist/node/index.d.cts 5.94 KB
@@ -1,9 +1,9 @@
1
1
 
2
- > @cartridge/controller@0.11.1 build /home/runner/work/controller/controller/packages/controller
2
+ > @cartridge/controller@0.11.2-alpha.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.11.1 build:browser /home/runner/work/controller/controller/packages/controller
6
+ > @cartridge/controller@0.11.2-alpha.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...
@@ -14,13 +14,13 @@ rendering chunks...
14
14
  [vite:dts] Start generate declaration files...
15
15
  computing gzip size...
16
16
  dist/session.js  8.75 kB │ gzip: 2.69 kB │ map: 20.54 kB
17
- dist/provider-GfOahKeA.js  13.95 kB │ gzip: 5.76 kB │ map: 36.06 kB
18
- dist/index.js 140.99 kB │ gzip: 35.90 kB │ map: 452.82 kB
19
- [vite:dts] Declaration files built in 4314ms.
17
+ dist/provider-DHDBdWz-.js  13.96 kB │ gzip: 5.77 kB │ map: 36.24 kB
18
+ dist/index.js 141.56 kB │ gzip: 36.01 kB │ map: 454.77 kB
19
+ [vite:dts] Declaration files built in 4322ms.
20
20
 
21
- ✓ built in 6.24s
21
+ ✓ built in 6.35s
22
22
 
23
- > @cartridge/controller@0.11.1 build:node /home/runner/work/controller/controller/packages/controller
23
+ > @cartridge/controller@0.11.2-alpha.2 build:node /home/runner/work/controller/controller/packages/controller
24
24
  > tsup --config tsup.node.config.ts
25
25
 
26
26
  CLI Building entry: src/node/index.ts
@@ -31,16 +31,16 @@ computing gzip size...
31
31
  CLI Cleaning output folder
32
32
  ESM Build start
33
33
  CJS Build start
34
- "constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
35
34
  "constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.cjs".
36
35
  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
- ESM dist/node/index.js 21.53 KB
36
+ "constants", "getChecksumAddress" and "shortString" are imported from external module "starknet" but never used in "dist/node/index.js".
37
+ CJS dist/node/index.cjs 22.33 KB
38
+ CJS dist/node/index.cjs.map 51.37 KB
39
+ CJS ⚡️ Build success in 324ms
40
+ ESM dist/node/index.js 21.54 KB
38
41
  ESM dist/node/index.js.map 51.13 KB
39
- ESM ⚡️ Build success in 321ms
40
- CJS dist/node/index.cjs 22.32 KB
41
- CJS dist/node/index.cjs.map 51.36 KB
42
- CJS ⚡️ Build success in 322ms
42
+ ESM ⚡️ Build success in 324ms
43
43
  DTS Build start
44
- DTS ⚡️ Build success in 4214ms
44
+ DTS ⚡️ Build success in 4422ms
45
45
  DTS dist/node/index.d.ts 5.94 KB
46
46
  DTS dist/node/index.d.cts 5.94 KB
@@ -2,7 +2,7 @@ import { Policy } from '@cartridge/presets';
2
2
  import { AddStarknetChainParameters } from '@starknet-io/types-js';
3
3
  import { WalletAccount } from 'starknet';
4
4
  import { default as BaseProvider } from './provider';
5
- import { ControllerOptions, ProfileContextTypeVariant, OpenOptions } from './types';
5
+ import { ControllerOptions, ProfileContextTypeVariant, OpenOptions, StarterpackOptions } from './types';
6
6
  export default class ControllerProvider extends BaseProvider {
7
7
  private keychain?;
8
8
  private options;
@@ -26,7 +26,7 @@ export default class ControllerProvider extends BaseProvider {
26
26
  rpcUrl(): string;
27
27
  username(): Promise<string> | undefined;
28
28
  openPurchaseCredits(): void;
29
- openStarterPack(starterpackId: string | number): Promise<void>;
29
+ openStarterPack(id: string | number, options?: StarterpackOptions): Promise<void>;
30
30
  openExecute(calls: any, chainId?: string): Promise<{
31
31
  status: boolean;
32
32
  transactionHash: string;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { WalletAccount as Rt, constants as K, num as nt, shortString as Oe } from "starknet";
2
- import { R as Q, t as Ut, i as Tt, K as be, B as zt, N as E, p as Lt, v as Dt, A as Ot } from "./provider-GfOahKeA.js";
3
- import { a as Xn, d as Jn, E as Zn, f as es, e as ts, F as rs, I as ns, h as ss, n as os, b as is, c as as } from "./provider-GfOahKeA.js";
2
+ import { R as Q, t as Ut, i as Tt, K as be, B as zt, N as E, p as Lt, v as Dt, A as Ot } from "./provider-DHDBdWz-.js";
3
+ import { a as Xn, d as Jn, E as Zn, f as es, e as ts, F as rs, I as ns, h as ss, n as os, b as is, c as as } from "./provider-DHDBdWz-.js";
4
4
  class Me extends Rt {
5
5
  keychain;
6
6
  modal;
@@ -3393,12 +3393,14 @@ class Qn extends zt {
3393
3393
  return;
3394
3394
  }
3395
3395
  if (typeof window < "u" && typeof localStorage < "u") {
3396
- const i = o?.get("lastUsedConnector");
3397
- if (i && localStorage.setItem("lastUsedConnector", i), o && window.history?.replaceState) {
3398
- let a = !1;
3399
- if (i && (o.delete("lastUsedConnector"), a = !0), o.has("controller_redirect") && (o.delete("controller_redirect"), a = !0), a) {
3400
- const l = window.location.pathname + (o.toString() ? "?" + o.toString() : "") + window.location.hash;
3401
- window.history.replaceState({}, "", l);
3396
+ const i = o?.get("controller_standalone");
3397
+ i === "1" && sessionStorage.setItem("controller_standalone", "1");
3398
+ const a = o?.get("lastUsedConnector");
3399
+ if (a && localStorage.setItem("lastUsedConnector", a), o && window.history?.replaceState) {
3400
+ let l = !1;
3401
+ if (i && (o.delete("controller_standalone"), l = !0), a && (o.delete("lastUsedConnector"), l = !0), o.has("controller_redirect") && (o.delete("controller_redirect"), l = !0), l) {
3402
+ const c = window.location.pathname + (o.toString() ? "?" + o.toString() : "") + window.location.hash;
3403
+ window.history.replaceState({}, "", c);
3402
3404
  }
3403
3405
  }
3404
3406
  }
@@ -3584,13 +3586,13 @@ class Qn extends zt {
3584
3586
  });
3585
3587
  }
3586
3588
  }
3587
- async openStarterPack(e) {
3589
+ async openStarterPack(e, r) {
3588
3590
  if (this.iframes) {
3589
3591
  if (!this.keychain || !this.iframes.keychain) {
3590
3592
  console.error(new E().message);
3591
3593
  return;
3592
3594
  }
3593
- await this.keychain.openStarterPack(e), this.iframes.keychain?.open();
3595
+ await this.keychain.openStarterPack(e, r), this.iframes.keychain?.open();
3594
3596
  }
3595
3597
  }
3596
3598
  async openExecute(e, r) {
@@ -3670,7 +3672,12 @@ class Qn extends zt {
3670
3672
  rpcUrl: this.rpcUrl(),
3671
3673
  onClose: this.keychain?.reset,
3672
3674
  onConnect: (e) => {
3673
- this.keychain = e;
3675
+ this.keychain = e, typeof window < "u" && typeof sessionStorage < "u" && sessionStorage.getItem("controller_standalone") === "1" && (sessionStorage.removeItem("controller_standalone"), this.keychain.requestStorageAccess && this.keychain.requestStorageAccess().catch((n) => {
3676
+ console.warn(
3677
+ "Failed to request storage access after redirect:",
3678
+ n
3679
+ );
3680
+ }));
3674
3681
  },
3675
3682
  version: Dt,
3676
3683
  ref: this.referral.ref,