@worldcoin/minikit-js 0.0.28-internal-alpha → 0.0.30-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 +20 -3
- package/build/index.d.cts +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +20 -3
- package/package.json +1 -1
package/build/index.cjs
CHANGED
|
@@ -453,7 +453,18 @@ var _MiniKit = class _MiniKit {
|
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
455
|
static subscribe(event, handler) {
|
|
456
|
-
|
|
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];
|
|
@@ -466,8 +477,13 @@ var _MiniKit = class _MiniKit {
|
|
|
466
477
|
this.listeners[event](payload);
|
|
467
478
|
}
|
|
468
479
|
static commandsValid(input) {
|
|
469
|
-
return
|
|
470
|
-
(
|
|
480
|
+
return Object.entries(this.commandVersion).every(
|
|
481
|
+
([commandName, version]) => {
|
|
482
|
+
const commandInput = input.find(
|
|
483
|
+
(command) => command.name === commandName
|
|
484
|
+
);
|
|
485
|
+
return commandInput ? commandInput.supported_versions.includes(version) : false;
|
|
486
|
+
}
|
|
471
487
|
);
|
|
472
488
|
}
|
|
473
489
|
static install() {
|
|
@@ -536,6 +552,7 @@ _MiniKit.listeners = {
|
|
|
536
552
|
["miniapp-sign-typed-data" /* MiniAppSignTypedData */]: () => {
|
|
537
553
|
}
|
|
538
554
|
};
|
|
555
|
+
_MiniKit.walletAddress = null;
|
|
539
556
|
_MiniKit.commands = {
|
|
540
557
|
verify: (payload) => {
|
|
541
558
|
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
|
-
|
|
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];
|
|
@@ -419,8 +430,13 @@ var _MiniKit = class _MiniKit {
|
|
|
419
430
|
this.listeners[event](payload);
|
|
420
431
|
}
|
|
421
432
|
static commandsValid(input) {
|
|
422
|
-
return
|
|
423
|
-
(
|
|
433
|
+
return Object.entries(this.commandVersion).every(
|
|
434
|
+
([commandName, version]) => {
|
|
435
|
+
const commandInput = input.find(
|
|
436
|
+
(command) => command.name === commandName
|
|
437
|
+
);
|
|
438
|
+
return commandInput ? commandInput.supported_versions.includes(version) : false;
|
|
439
|
+
}
|
|
424
440
|
);
|
|
425
441
|
}
|
|
426
442
|
static install() {
|
|
@@ -489,6 +505,7 @@ _MiniKit.listeners = {
|
|
|
489
505
|
["miniapp-sign-typed-data" /* MiniAppSignTypedData */]: () => {
|
|
490
506
|
}
|
|
491
507
|
};
|
|
508
|
+
_MiniKit.walletAddress = null;
|
|
492
509
|
_MiniKit.commands = {
|
|
493
510
|
verify: (payload) => {
|
|
494
511
|
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.
|
|
3
|
+
"version": "0.0.30-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",
|