@worldcoin/minikit-js 0.0.35-internal-alpha-temp-fix → 0.0.37-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 +30 -6
- package/build/index.d.cts +3 -3
- package/build/index.d.ts +3 -3
- package/build/index.js +27 -3
- package/package.json +4 -4
package/build/index.cjs
CHANGED
|
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
21
|
+
var core_exports = {};
|
|
22
|
+
__export(core_exports, {
|
|
23
23
|
Command: () => Command,
|
|
24
24
|
MiniKit: () => MiniKit,
|
|
25
25
|
MiniKitInstallErrorCodes: () => MiniKitInstallErrorCodes,
|
|
@@ -48,7 +48,7 @@ __export(src_exports, {
|
|
|
48
48
|
verifyCloudProof: () => import_backend.verifyCloudProof,
|
|
49
49
|
verifySiweMessage: () => verifySiweMessage
|
|
50
50
|
});
|
|
51
|
-
module.exports = __toCommonJS(
|
|
51
|
+
module.exports = __toCommonJS(core_exports);
|
|
52
52
|
|
|
53
53
|
// helpers/send-webview-event.ts
|
|
54
54
|
var sendWebviewEvent = (payload) => {
|
|
@@ -214,6 +214,7 @@ var MiniKitInstallErrorMessage = {
|
|
|
214
214
|
|
|
215
215
|
// minikit.ts
|
|
216
216
|
var import_idkit_core3 = require("@worldcoin/idkit-core");
|
|
217
|
+
var import_hashing = require("@worldcoin/idkit-core/hashing");
|
|
217
218
|
|
|
218
219
|
// helpers/siwe/validate-wallet-auth-command-input.ts
|
|
219
220
|
var validateWalletAuthCommandInput = (params) => {
|
|
@@ -523,6 +524,11 @@ var _MiniKit = class _MiniKit {
|
|
|
523
524
|
};
|
|
524
525
|
}
|
|
525
526
|
if (!this.commandsValid(window.WorldApp.supported_commands)) {
|
|
527
|
+
return {
|
|
528
|
+
success: false,
|
|
529
|
+
errorCode: "app_out_of_date" /* AppOutOfDate */,
|
|
530
|
+
errorMessage: MiniKitInstallErrorMessage["app_out_of_date" /* AppOutOfDate */]
|
|
531
|
+
};
|
|
526
532
|
}
|
|
527
533
|
return { success: true };
|
|
528
534
|
}
|
|
@@ -578,8 +584,8 @@ _MiniKit.commands = {
|
|
|
578
584
|
}
|
|
579
585
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
580
586
|
const eventPayload = {
|
|
581
|
-
|
|
582
|
-
signal: payload.signal
|
|
587
|
+
action: (0, import_hashing.encodeAction)(payload.action),
|
|
588
|
+
signal: (0, import_hashing.generateSignal)(payload.signal).digest,
|
|
583
589
|
verification_level: payload.verification_level || import_idkit_core3.VerificationLevel.Orb,
|
|
584
590
|
timestamp
|
|
585
591
|
};
|
|
@@ -600,7 +606,7 @@ _MiniKit.commands = {
|
|
|
600
606
|
if (!validatePaymentPayload(payload)) {
|
|
601
607
|
return null;
|
|
602
608
|
}
|
|
603
|
-
const network = "
|
|
609
|
+
const network = "worldchain" /* WorldChain */;
|
|
604
610
|
const eventPayload = {
|
|
605
611
|
...payload,
|
|
606
612
|
network
|
|
@@ -657,6 +663,12 @@ _MiniKit.commands = {
|
|
|
657
663
|
return walletAuthPayload;
|
|
658
664
|
},
|
|
659
665
|
sendTransaction: (payload) => {
|
|
666
|
+
if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["send-transaction" /* SendTransaction */]) {
|
|
667
|
+
console.error(
|
|
668
|
+
"'sendTransaction' command is unavailable. Check MiniKit.install() or update the app version"
|
|
669
|
+
);
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
660
672
|
sendMiniKitEvent({
|
|
661
673
|
command: "send-transaction" /* SendTransaction */,
|
|
662
674
|
version: 1,
|
|
@@ -665,6 +677,12 @@ _MiniKit.commands = {
|
|
|
665
677
|
return payload;
|
|
666
678
|
},
|
|
667
679
|
signMessage: (payload) => {
|
|
680
|
+
if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["sign-message" /* SignMessage */]) {
|
|
681
|
+
console.error(
|
|
682
|
+
"'signMessage' command is unavailable. Check MiniKit.install() or update the app version"
|
|
683
|
+
);
|
|
684
|
+
return null;
|
|
685
|
+
}
|
|
668
686
|
sendMiniKitEvent({
|
|
669
687
|
command: "sign-message" /* SignMessage */,
|
|
670
688
|
version: 1,
|
|
@@ -673,6 +691,12 @@ _MiniKit.commands = {
|
|
|
673
691
|
return payload;
|
|
674
692
|
},
|
|
675
693
|
signTypedData: (payload) => {
|
|
694
|
+
if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["sign-typed-data" /* SignTypedData */]) {
|
|
695
|
+
console.error(
|
|
696
|
+
"'signTypedData' command is unavailable. Check MiniKit.install() or update the app version"
|
|
697
|
+
);
|
|
698
|
+
return null;
|
|
699
|
+
}
|
|
676
700
|
sendMiniKitEvent({
|
|
677
701
|
command: "sign-typed-data" /* SignTypedData */,
|
|
678
702
|
version: 1,
|
package/build/index.d.cts
CHANGED
|
@@ -261,7 +261,7 @@ type MiniAppSendTransactionSuccessPayload = {
|
|
|
261
261
|
type MiniAppSendTransactionErrorPayload = {
|
|
262
262
|
status: "error";
|
|
263
263
|
error_code: SendTransactionErrorCodes;
|
|
264
|
-
|
|
264
|
+
details?: Record<string, any>;
|
|
265
265
|
version: number;
|
|
266
266
|
};
|
|
267
267
|
type MiniAppSendTransactionPayload = MiniAppSendTransactionSuccessPayload | MiniAppSendTransactionErrorPayload;
|
|
@@ -274,7 +274,7 @@ type MiniAppSignMessageSuccessPayload = {
|
|
|
274
274
|
type MiniAppSignMessageErrorPayload = {
|
|
275
275
|
status: "error";
|
|
276
276
|
error_code: SignMessageErrorCodes;
|
|
277
|
-
|
|
277
|
+
details?: Record<string, any>;
|
|
278
278
|
version: number;
|
|
279
279
|
};
|
|
280
280
|
type MiniAppSignMessagePayload = MiniAppSignMessageSuccessPayload | MiniAppSignMessageErrorPayload;
|
|
@@ -287,7 +287,7 @@ type MiniAppSignTypedDataSuccessPayload = {
|
|
|
287
287
|
type MiniAppSignTypedDataErrorPayload = {
|
|
288
288
|
status: "error";
|
|
289
289
|
error_code: SignTypedDataErrorCodes;
|
|
290
|
-
|
|
290
|
+
details?: Record<string, any>;
|
|
291
291
|
version: number;
|
|
292
292
|
};
|
|
293
293
|
type MiniAppSignTypedDataPayload = MiniAppSignTypedDataSuccessPayload | MiniAppSignTypedDataErrorPayload;
|
package/build/index.d.ts
CHANGED
|
@@ -261,7 +261,7 @@ type MiniAppSendTransactionSuccessPayload = {
|
|
|
261
261
|
type MiniAppSendTransactionErrorPayload = {
|
|
262
262
|
status: "error";
|
|
263
263
|
error_code: SendTransactionErrorCodes;
|
|
264
|
-
|
|
264
|
+
details?: Record<string, any>;
|
|
265
265
|
version: number;
|
|
266
266
|
};
|
|
267
267
|
type MiniAppSendTransactionPayload = MiniAppSendTransactionSuccessPayload | MiniAppSendTransactionErrorPayload;
|
|
@@ -274,7 +274,7 @@ type MiniAppSignMessageSuccessPayload = {
|
|
|
274
274
|
type MiniAppSignMessageErrorPayload = {
|
|
275
275
|
status: "error";
|
|
276
276
|
error_code: SignMessageErrorCodes;
|
|
277
|
-
|
|
277
|
+
details?: Record<string, any>;
|
|
278
278
|
version: number;
|
|
279
279
|
};
|
|
280
280
|
type MiniAppSignMessagePayload = MiniAppSignMessageSuccessPayload | MiniAppSignMessageErrorPayload;
|
|
@@ -287,7 +287,7 @@ type MiniAppSignTypedDataSuccessPayload = {
|
|
|
287
287
|
type MiniAppSignTypedDataErrorPayload = {
|
|
288
288
|
status: "error";
|
|
289
289
|
error_code: SignTypedDataErrorCodes;
|
|
290
|
-
|
|
290
|
+
details?: Record<string, any>;
|
|
291
291
|
version: number;
|
|
292
292
|
};
|
|
293
293
|
type MiniAppSignTypedDataPayload = MiniAppSignTypedDataSuccessPayload | MiniAppSignTypedDataErrorPayload;
|
package/build/index.js
CHANGED
|
@@ -162,6 +162,7 @@ var MiniKitInstallErrorMessage = {
|
|
|
162
162
|
|
|
163
163
|
// minikit.ts
|
|
164
164
|
import { VerificationLevel } from "@worldcoin/idkit-core";
|
|
165
|
+
import { generateSignal, encodeAction } from "@worldcoin/idkit-core/hashing";
|
|
165
166
|
|
|
166
167
|
// helpers/siwe/validate-wallet-auth-command-input.ts
|
|
167
168
|
var validateWalletAuthCommandInput = (params) => {
|
|
@@ -476,6 +477,11 @@ var _MiniKit = class _MiniKit {
|
|
|
476
477
|
};
|
|
477
478
|
}
|
|
478
479
|
if (!this.commandsValid(window.WorldApp.supported_commands)) {
|
|
480
|
+
return {
|
|
481
|
+
success: false,
|
|
482
|
+
errorCode: "app_out_of_date" /* AppOutOfDate */,
|
|
483
|
+
errorMessage: MiniKitInstallErrorMessage["app_out_of_date" /* AppOutOfDate */]
|
|
484
|
+
};
|
|
479
485
|
}
|
|
480
486
|
return { success: true };
|
|
481
487
|
}
|
|
@@ -531,8 +537,8 @@ _MiniKit.commands = {
|
|
|
531
537
|
}
|
|
532
538
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
533
539
|
const eventPayload = {
|
|
534
|
-
|
|
535
|
-
signal: payload.signal
|
|
540
|
+
action: encodeAction(payload.action),
|
|
541
|
+
signal: generateSignal(payload.signal).digest,
|
|
536
542
|
verification_level: payload.verification_level || VerificationLevel.Orb,
|
|
537
543
|
timestamp
|
|
538
544
|
};
|
|
@@ -553,7 +559,7 @@ _MiniKit.commands = {
|
|
|
553
559
|
if (!validatePaymentPayload(payload)) {
|
|
554
560
|
return null;
|
|
555
561
|
}
|
|
556
|
-
const network = "
|
|
562
|
+
const network = "worldchain" /* WorldChain */;
|
|
557
563
|
const eventPayload = {
|
|
558
564
|
...payload,
|
|
559
565
|
network
|
|
@@ -610,6 +616,12 @@ _MiniKit.commands = {
|
|
|
610
616
|
return walletAuthPayload;
|
|
611
617
|
},
|
|
612
618
|
sendTransaction: (payload) => {
|
|
619
|
+
if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["send-transaction" /* SendTransaction */]) {
|
|
620
|
+
console.error(
|
|
621
|
+
"'sendTransaction' command is unavailable. Check MiniKit.install() or update the app version"
|
|
622
|
+
);
|
|
623
|
+
return null;
|
|
624
|
+
}
|
|
613
625
|
sendMiniKitEvent({
|
|
614
626
|
command: "send-transaction" /* SendTransaction */,
|
|
615
627
|
version: 1,
|
|
@@ -618,6 +630,12 @@ _MiniKit.commands = {
|
|
|
618
630
|
return payload;
|
|
619
631
|
},
|
|
620
632
|
signMessage: (payload) => {
|
|
633
|
+
if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["sign-message" /* SignMessage */]) {
|
|
634
|
+
console.error(
|
|
635
|
+
"'signMessage' command is unavailable. Check MiniKit.install() or update the app version"
|
|
636
|
+
);
|
|
637
|
+
return null;
|
|
638
|
+
}
|
|
621
639
|
sendMiniKitEvent({
|
|
622
640
|
command: "sign-message" /* SignMessage */,
|
|
623
641
|
version: 1,
|
|
@@ -626,6 +644,12 @@ _MiniKit.commands = {
|
|
|
626
644
|
return payload;
|
|
627
645
|
},
|
|
628
646
|
signTypedData: (payload) => {
|
|
647
|
+
if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["sign-typed-data" /* SignTypedData */]) {
|
|
648
|
+
console.error(
|
|
649
|
+
"'signTypedData' command is unavailable. Check MiniKit.install() or update the app version"
|
|
650
|
+
);
|
|
651
|
+
return null;
|
|
652
|
+
}
|
|
629
653
|
sendMiniKitEvent({
|
|
630
654
|
command: "sign-typed-data" /* SignTypedData */,
|
|
631
655
|
version: 1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@worldcoin/minikit-js",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37-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",
|
|
@@ -41,8 +41,7 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@worldcoin/idkit-core": "^1.3.0",
|
|
44
|
-
"abitype": "^1.0.6"
|
|
45
|
-
"turbo": "^2.1.1"
|
|
44
|
+
"abitype": "^1.0.6"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
47
|
"@types/node": "^20",
|
|
@@ -51,7 +50,8 @@
|
|
|
51
50
|
"prettier": "^3.2.5",
|
|
52
51
|
"prettier-plugin-sort-imports-desc": "^1.0.0",
|
|
53
52
|
"tsup": "^8.0.2",
|
|
54
|
-
"typescript": "^5.4.5"
|
|
53
|
+
"typescript": "^5.4.5",
|
|
54
|
+
"viem": "^2.21.18"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"viem": "^2.0.0"
|