@worldcoin/minikit-js 0.0.25-internal-alpha → 0.0.27-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
@@ -447,7 +447,7 @@ var _MiniKit = class _MiniKit {
447
447
  static isInstalled(debug) {
448
448
  if (debug)
449
449
  console.log("MiniKit is alive!");
450
- return true;
450
+ return Boolean(window.MiniKit);
451
451
  }
452
452
  };
453
453
  _MiniKit.MINIKIT_VERSION = 1;
package/build/index.d.cts CHANGED
@@ -91,7 +91,7 @@ type MiniAppVerifyActionErrorPayload = {
91
91
  version: number;
92
92
  };
93
93
  type MiniAppVerifyActionPayload = MiniAppVerifyActionSuccessPayload | MiniAppVerifyActionErrorPayload;
94
- type MiniAppPaymentSuccessEventPayload = {
94
+ type MiniAppPaymentSuccessPayload = {
95
95
  status: "success";
96
96
  transaction_status: "submitted";
97
97
  transaction_id: string;
@@ -106,7 +106,7 @@ type MiniAppPaymentErrorPayload = {
106
106
  error_code: PaymentErrorCodes;
107
107
  version: number;
108
108
  };
109
- type MiniAppPaymentPayload = MiniAppPaymentSuccessEventPayload | MiniAppPaymentErrorPayload;
109
+ type MiniAppPaymentPayload = MiniAppPaymentSuccessPayload | MiniAppPaymentErrorPayload;
110
110
  type MiniAppWalletAuthSuccessPayload = {
111
111
  status: "success";
112
112
  message: string;
@@ -120,7 +120,13 @@ type MiniAppWalletAuthErrorPayload = {
120
120
  details: (typeof WalletAuthErrorMessage)[WalletAuthErrorCodes];
121
121
  version: number;
122
122
  };
123
- type EventPayload<T extends ResponseEvent = ResponseEvent> = T extends ResponseEvent.MiniAppVerifyAction ? MiniAppVerifyActionPayload : MiniAppPaymentPayload;
123
+ type MiniAppWalletAuthPayload = MiniAppWalletAuthSuccessPayload | MiniAppWalletAuthErrorPayload;
124
+ type EventPayloadMap = {
125
+ [ResponseEvent.MiniAppVerifyAction]: MiniAppVerifyActionPayload;
126
+ [ResponseEvent.MiniAppPayment]: MiniAppPaymentPayload;
127
+ [ResponseEvent.MiniAppWalletAuth]: MiniAppWalletAuthPayload;
128
+ };
129
+ type EventPayload<T extends ResponseEvent = ResponseEvent> = T extends keyof EventPayloadMap ? EventPayloadMap[T] : never;
124
130
  type EventHandler<E extends ResponseEvent = ResponseEvent> = <T extends EventPayload<E>>(data: T) => void;
125
131
 
126
132
  declare const parseSiweMessage: (inputString: string) => SiweMessage;
@@ -205,4 +211,4 @@ declare class MiniKit {
205
211
 
206
212
  declare const tokenToDecimals: (amount: number, token: Tokens) => number;
207
213
 
208
- export { Command, type MiniAppPaymentErrorPayload, type MiniAppPaymentPayload, type MiniAppPaymentSuccessEventPayload, type MiniAppVerifyActionErrorPayload, type MiniAppVerifyActionPayload, type MiniAppVerifyActionSuccessPayload, type MiniAppWalletAuthErrorPayload, type MiniAppWalletAuthSuccessPayload, MiniKit, MiniKitInstallErrorCode, MiniKitInstallErrorMessage, Network, type PayCommandInput, PaymentErrorCodes, PaymentErrorMessage, PaymentValidationErrors, ResponseEvent, SAFE_CONTRACT_ABI, type SiweMessage, TokenDecimals, Tokens, VerificationErrorMessage, type VerifyCommandInput, WalletAuthErrorCodes, WalletAuthErrorMessage, parseSiweMessage, tokenToDecimals, verifySiweMessage };
214
+ export { Command, type MiniAppPaymentErrorPayload, type MiniAppPaymentPayload, type MiniAppPaymentSuccessPayload, type MiniAppVerifyActionErrorPayload, type MiniAppVerifyActionPayload, type MiniAppVerifyActionSuccessPayload, type MiniAppWalletAuthErrorPayload, type MiniAppWalletAuthPayload, type MiniAppWalletAuthSuccessPayload, MiniKit, MiniKitInstallErrorCode, MiniKitInstallErrorMessage, Network, type PayCommandInput, PaymentErrorCodes, PaymentErrorMessage, PaymentValidationErrors, ResponseEvent, SAFE_CONTRACT_ABI, type SiweMessage, TokenDecimals, Tokens, VerificationErrorMessage, type VerifyCommandInput, WalletAuthErrorCodes, WalletAuthErrorMessage, parseSiweMessage, tokenToDecimals, verifySiweMessage };
package/build/index.d.ts CHANGED
@@ -91,7 +91,7 @@ type MiniAppVerifyActionErrorPayload = {
91
91
  version: number;
92
92
  };
93
93
  type MiniAppVerifyActionPayload = MiniAppVerifyActionSuccessPayload | MiniAppVerifyActionErrorPayload;
94
- type MiniAppPaymentSuccessEventPayload = {
94
+ type MiniAppPaymentSuccessPayload = {
95
95
  status: "success";
96
96
  transaction_status: "submitted";
97
97
  transaction_id: string;
@@ -106,7 +106,7 @@ type MiniAppPaymentErrorPayload = {
106
106
  error_code: PaymentErrorCodes;
107
107
  version: number;
108
108
  };
109
- type MiniAppPaymentPayload = MiniAppPaymentSuccessEventPayload | MiniAppPaymentErrorPayload;
109
+ type MiniAppPaymentPayload = MiniAppPaymentSuccessPayload | MiniAppPaymentErrorPayload;
110
110
  type MiniAppWalletAuthSuccessPayload = {
111
111
  status: "success";
112
112
  message: string;
@@ -120,7 +120,13 @@ type MiniAppWalletAuthErrorPayload = {
120
120
  details: (typeof WalletAuthErrorMessage)[WalletAuthErrorCodes];
121
121
  version: number;
122
122
  };
123
- type EventPayload<T extends ResponseEvent = ResponseEvent> = T extends ResponseEvent.MiniAppVerifyAction ? MiniAppVerifyActionPayload : MiniAppPaymentPayload;
123
+ type MiniAppWalletAuthPayload = MiniAppWalletAuthSuccessPayload | MiniAppWalletAuthErrorPayload;
124
+ type EventPayloadMap = {
125
+ [ResponseEvent.MiniAppVerifyAction]: MiniAppVerifyActionPayload;
126
+ [ResponseEvent.MiniAppPayment]: MiniAppPaymentPayload;
127
+ [ResponseEvent.MiniAppWalletAuth]: MiniAppWalletAuthPayload;
128
+ };
129
+ type EventPayload<T extends ResponseEvent = ResponseEvent> = T extends keyof EventPayloadMap ? EventPayloadMap[T] : never;
124
130
  type EventHandler<E extends ResponseEvent = ResponseEvent> = <T extends EventPayload<E>>(data: T) => void;
125
131
 
126
132
  declare const parseSiweMessage: (inputString: string) => SiweMessage;
@@ -205,4 +211,4 @@ declare class MiniKit {
205
211
 
206
212
  declare const tokenToDecimals: (amount: number, token: Tokens) => number;
207
213
 
208
- export { Command, type MiniAppPaymentErrorPayload, type MiniAppPaymentPayload, type MiniAppPaymentSuccessEventPayload, type MiniAppVerifyActionErrorPayload, type MiniAppVerifyActionPayload, type MiniAppVerifyActionSuccessPayload, type MiniAppWalletAuthErrorPayload, type MiniAppWalletAuthSuccessPayload, MiniKit, MiniKitInstallErrorCode, MiniKitInstallErrorMessage, Network, type PayCommandInput, PaymentErrorCodes, PaymentErrorMessage, PaymentValidationErrors, ResponseEvent, SAFE_CONTRACT_ABI, type SiweMessage, TokenDecimals, Tokens, VerificationErrorMessage, type VerifyCommandInput, WalletAuthErrorCodes, WalletAuthErrorMessage, parseSiweMessage, tokenToDecimals, verifySiweMessage };
214
+ export { Command, type MiniAppPaymentErrorPayload, type MiniAppPaymentPayload, type MiniAppPaymentSuccessPayload, type MiniAppVerifyActionErrorPayload, type MiniAppVerifyActionPayload, type MiniAppVerifyActionSuccessPayload, type MiniAppWalletAuthErrorPayload, type MiniAppWalletAuthPayload, type MiniAppWalletAuthSuccessPayload, MiniKit, MiniKitInstallErrorCode, MiniKitInstallErrorMessage, Network, type PayCommandInput, PaymentErrorCodes, PaymentErrorMessage, PaymentValidationErrors, ResponseEvent, SAFE_CONTRACT_ABI, type SiweMessage, TokenDecimals, Tokens, VerificationErrorMessage, type VerifyCommandInput, WalletAuthErrorCodes, WalletAuthErrorMessage, parseSiweMessage, tokenToDecimals, verifySiweMessage };
package/build/index.js CHANGED
@@ -401,7 +401,7 @@ var _MiniKit = class _MiniKit {
401
401
  static isInstalled(debug) {
402
402
  if (debug)
403
403
  console.log("MiniKit is alive!");
404
- return true;
404
+ return Boolean(window.MiniKit);
405
405
  }
406
406
  };
407
407
  _MiniKit.MINIKIT_VERSION = 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worldcoin/minikit-js",
3
- "version": "0.0.25-internal-alpha",
3
+ "version": "0.0.27-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",