@worldcoin/minikit-js 0.0.26-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.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worldcoin/minikit-js",
3
- "version": "0.0.26-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",