@worldcoin/minikit-js 0.0.28-internal-alpha → 0.0.29-internal-alpha

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/build/index.cjs CHANGED
@@ -453,7 +453,18 @@ var _MiniKit = class _MiniKit {
453
453
  });
454
454
  }
455
455
  static subscribe(event, handler) {
456
- this.listeners[event] = handler;
456
+ if (event === "miniapp-wallet-auth" /* MiniAppWalletAuth */) {
457
+ const originalHandler = handler;
458
+ const wrappedHandler = (payload) => {
459
+ if (payload.status === "success") {
460
+ _MiniKit.walletAddress = payload.address;
461
+ }
462
+ originalHandler(payload);
463
+ };
464
+ this.listeners[event] = wrappedHandler;
465
+ } else {
466
+ this.listeners[event] = handler;
467
+ }
457
468
  }
458
469
  static unsubscribe(event) {
459
470
  delete this.listeners[event];
@@ -536,6 +547,7 @@ _MiniKit.listeners = {
536
547
  ["miniapp-sign-typed-data" /* MiniAppSignTypedData */]: () => {
537
548
  }
538
549
  };
550
+ _MiniKit.walletAddress = null;
539
551
  _MiniKit.commands = {
540
552
  verify: (payload) => {
541
553
  const timestamp = (/* @__PURE__ */ new Date()).toISOString();
package/build/index.d.cts CHANGED
@@ -318,6 +318,7 @@ declare class MiniKit {
318
318
  private static readonly MINIKIT_VERSION;
319
319
  private static readonly commandVersion;
320
320
  private static listeners;
321
+ static walletAddress: string | null;
321
322
  private static sendInit;
322
323
  static subscribe<E extends ResponseEvent>(event: E, handler: EventHandler<E>): void;
323
324
  static unsubscribe(event: ResponseEvent): void;
package/build/index.d.ts CHANGED
@@ -318,6 +318,7 @@ declare class MiniKit {
318
318
  private static readonly MINIKIT_VERSION;
319
319
  private static readonly commandVersion;
320
320
  private static listeners;
321
+ static walletAddress: string | null;
321
322
  private static sendInit;
322
323
  static subscribe<E extends ResponseEvent>(event: E, handler: EventHandler<E>): void;
323
324
  static unsubscribe(event: ResponseEvent): void;
package/build/index.js CHANGED
@@ -406,7 +406,18 @@ var _MiniKit = class _MiniKit {
406
406
  });
407
407
  }
408
408
  static subscribe(event, handler) {
409
- this.listeners[event] = handler;
409
+ if (event === "miniapp-wallet-auth" /* MiniAppWalletAuth */) {
410
+ const originalHandler = handler;
411
+ const wrappedHandler = (payload) => {
412
+ if (payload.status === "success") {
413
+ _MiniKit.walletAddress = payload.address;
414
+ }
415
+ originalHandler(payload);
416
+ };
417
+ this.listeners[event] = wrappedHandler;
418
+ } else {
419
+ this.listeners[event] = handler;
420
+ }
410
421
  }
411
422
  static unsubscribe(event) {
412
423
  delete this.listeners[event];
@@ -489,6 +500,7 @@ _MiniKit.listeners = {
489
500
  ["miniapp-sign-typed-data" /* MiniAppSignTypedData */]: () => {
490
501
  }
491
502
  };
503
+ _MiniKit.walletAddress = null;
492
504
  _MiniKit.commands = {
493
505
  verify: (payload) => {
494
506
  const timestamp = (/* @__PURE__ */ new Date()).toISOString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worldcoin/minikit-js",
3
- "version": "0.0.28-internal-alpha",
3
+ "version": "0.0.29-internal-alpha",
4
4
  "homepage": "https://docs.worldcoin.org/id/minikit",
5
5
  "description": "Internal Alpha: Mini-kit JS is a lightweight sdk for building mini-apps compatible with World App",
6
6
  "license": "MIT",