@worldcoin/minikit-js 1.11.0 → 2.0.0-dev.1

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.
Files changed (39) hide show
  1. package/README.md +107 -0
  2. package/build/address-book.cjs +81 -0
  3. package/build/address-book.d.cts +3 -0
  4. package/build/address-book.d.ts +3 -0
  5. package/build/address-book.js +54 -0
  6. package/build/chunk-2UPJKPQ6.js +272 -0
  7. package/build/chunk-EHBM7OXH.js +596 -0
  8. package/build/chunk-LHHKY77D.js +274 -0
  9. package/build/chunk-TGXD24YD.js +279 -0
  10. package/build/chunk-Z2UGRZJ2.js +1635 -0
  11. package/build/command-exports.cjs +1762 -0
  12. package/build/command-exports.d.cts +105 -0
  13. package/build/command-exports.d.ts +105 -0
  14. package/build/command-exports.js +129 -0
  15. package/build/connector/index.cjs +2601 -0
  16. package/build/connector/index.d.cts +55 -0
  17. package/build/connector/index.d.ts +55 -0
  18. package/build/connector/index.js +90 -0
  19. package/build/index.cjs +1634 -1627
  20. package/build/index.d.cts +143 -671
  21. package/build/index.d.ts +143 -671
  22. package/build/index.js +7 -206
  23. package/build/minikit-provider.cjs +1650 -948
  24. package/build/minikit-provider.d.cts +2 -1
  25. package/build/minikit-provider.d.ts +2 -1
  26. package/build/minikit-provider.js +13 -2
  27. package/build/provider-DeDUsLbs.d.cts +43 -0
  28. package/build/provider-DeDUsLbs.d.ts +43 -0
  29. package/build/siwe-exports.cjs +249 -0
  30. package/build/siwe-exports.d.cts +10 -0
  31. package/build/siwe-exports.d.ts +10 -0
  32. package/build/siwe-exports.js +8 -0
  33. package/build/types-CC2x79HX.d.ts +525 -0
  34. package/build/types-CSyzFDPt.d.cts +223 -0
  35. package/build/types-CSyzFDPt.d.ts +223 -0
  36. package/build/types-_jfLbcJW.d.cts +525 -0
  37. package/package.json +73 -11
  38. package/build/chunk-62NZ34E4.js +0 -2092
  39. package/index.ts +0 -29
@@ -0,0 +1,525 @@
1
+ import { F as FallbackConfig, l as MiniAppBaseSuccessPayload, m as MiniAppBaseErrorPayload } from './types-CSyzFDPt.js';
2
+ import { Abi, AbiStateMutability, ExtractAbiFunctionNames, AbiParametersToPrimitiveTypes, ExtractAbiFunction, TypedData, TypedDataDomain } from 'abitype';
3
+
4
+ type AttestationParams = {
5
+ /**
6
+ * Hex-encoded hash of the request body to attest.
7
+ */
8
+ requestHash: string;
9
+ };
10
+ /** @deprecated Use {@link MiniKitAttestationOptions} instead */
11
+ type AttestationInput = AttestationParams;
12
+ interface MiniKitAttestationOptions<TCustomFallback = MiniAppAttestationSuccessPayload> extends AttestationParams, FallbackConfig<TCustomFallback> {
13
+ }
14
+ declare enum AttestationErrorCodes {
15
+ Unauthorized = "unauthorized",
16
+ AttestationFailed = "attestation_failed",
17
+ IntegrityFailed = "integrity_failed",
18
+ InvalidInput = "invalid_input",
19
+ UnsupportedVersion = "unsupported_version"
20
+ }
21
+ type MiniAppAttestationSuccessPayload = MiniAppBaseSuccessPayload & {
22
+ token: string;
23
+ };
24
+ type MiniAppAttestationErrorPayload = MiniAppBaseErrorPayload<AttestationErrorCodes> & {
25
+ description: string;
26
+ };
27
+ type MiniAppAttestationPayload = MiniAppAttestationSuccessPayload | MiniAppAttestationErrorPayload;
28
+ declare class AttestationError extends Error {
29
+ readonly error_code: AttestationErrorCodes;
30
+ constructor(error_code: AttestationErrorCodes);
31
+ }
32
+
33
+ type ChatParams = {
34
+ to?: string[];
35
+ message: string;
36
+ };
37
+ /** @deprecated Use {@link MiniKitChatOptions} instead */
38
+ type ChatInput = ChatParams;
39
+ interface MiniKitChatOptions<TCustomFallback = MiniAppChatPayload> extends ChatParams, FallbackConfig<TCustomFallback> {
40
+ }
41
+ declare enum ChatErrorCodes {
42
+ UserRejected = "user_rejected",
43
+ SendFailed = "send_failed",
44
+ GenericError = "generic_error"
45
+ }
46
+ type MiniAppChatSuccessPayload = MiniAppBaseSuccessPayload & {
47
+ count: number;
48
+ timestamp: string;
49
+ };
50
+ type MiniAppChatErrorPayload = MiniAppBaseErrorPayload<ChatErrorCodes>;
51
+ type MiniAppChatPayload = MiniAppChatSuccessPayload | MiniAppChatErrorPayload;
52
+ declare class ChatError extends Error {
53
+ readonly error_code: ChatErrorCodes;
54
+ constructor(error_code: ChatErrorCodes);
55
+ }
56
+
57
+ type CloseMiniAppResult = {
58
+ status: 'success';
59
+ version: number;
60
+ };
61
+ interface MiniKitCloseMiniAppOptions<TCustomFallback = CloseMiniAppResult> extends FallbackConfig<TCustomFallback> {
62
+ }
63
+
64
+ declare enum GetPermissionsErrorCodes {
65
+ GenericError = "generic_error"
66
+ }
67
+ declare enum Permission {
68
+ Notifications = "notifications",
69
+ Contacts = "contacts",
70
+ Microphone = "microphone"
71
+ }
72
+ type PermissionSettings = {
73
+ [K in Permission]?: any;
74
+ };
75
+ type MiniAppGetPermissionsSuccessPayload = MiniAppBaseSuccessPayload & {
76
+ permissions: PermissionSettings;
77
+ timestamp: string;
78
+ };
79
+ type MiniAppGetPermissionsErrorPayload = MiniAppBaseErrorPayload<GetPermissionsErrorCodes> & {
80
+ details: string;
81
+ };
82
+ type MiniAppGetPermissionsPayload = MiniAppGetPermissionsSuccessPayload | MiniAppGetPermissionsErrorPayload;
83
+ interface MiniKitGetPermissionsOptions<TCustomFallback = MiniAppGetPermissionsPayload> extends FallbackConfig<TCustomFallback> {
84
+ }
85
+ declare class GetPermissionsError extends Error {
86
+ readonly error_code: GetPermissionsErrorCodes;
87
+ constructor(error_code: GetPermissionsErrorCodes);
88
+ }
89
+
90
+ declare enum Tokens {
91
+ USDC = "USDCE",
92
+ WLD = "WLD",
93
+ WARS = "WARS",
94
+ WCOP = "WCOP",
95
+ WMXN = "WMXN",
96
+ WBRL = "WBRL",
97
+ WPEN = "WPEN",
98
+ WCLP = "WCLP",
99
+ EURC = "EURC"
100
+ }
101
+ declare const TokenDecimals: {
102
+ [key in Tokens]: number;
103
+ };
104
+ declare enum Network {
105
+ WorldChain = "worldchain"
106
+ }
107
+ type TokensPayload = {
108
+ symbol: Tokens;
109
+ token_amount: string;
110
+ };
111
+ /** @deprecated Use {@link MiniKitPayOptions} instead */
112
+ type PayCommandInput = {
113
+ reference: string;
114
+ to: `0x${string}` | string;
115
+ tokens: TokensPayload[];
116
+ network?: Network;
117
+ description: string;
118
+ };
119
+ /** @deprecated Use {@link MiniKitPayOptions} instead */
120
+ type PayCommandPayload = PayCommandInput;
121
+ declare enum PaymentErrorCodes {
122
+ InputError = "input_error",
123
+ UserRejected = "user_rejected",
124
+ PaymentRejected = "payment_rejected",
125
+ InvalidReceiver = "invalid_receiver",
126
+ InsufficientBalance = "insufficient_balance",
127
+ TransactionFailed = "transaction_failed",
128
+ GenericError = "generic_error",
129
+ UserBlocked = "user_blocked"
130
+ }
131
+ declare const PaymentErrorMessage: Record<PaymentErrorCodes, string>;
132
+ type MiniAppPaymentSuccessPayload = MiniAppBaseSuccessPayload & {
133
+ transaction_status: 'submitted';
134
+ transaction_id: string;
135
+ reference: string;
136
+ from: string;
137
+ chain: Network;
138
+ timestamp: string;
139
+ };
140
+ type MiniAppPaymentErrorPayload = MiniAppBaseErrorPayload<PaymentErrorCodes>;
141
+ type MiniAppPaymentPayload = MiniAppPaymentSuccessPayload | MiniAppPaymentErrorPayload;
142
+ interface MiniKitPayOptions<TCustomFallback = PayResult> extends FallbackConfig<TCustomFallback> {
143
+ /** Unique reference for this payment (for tracking) */
144
+ reference: string;
145
+ /** Recipient address */
146
+ to: `0x${string}` | string;
147
+ /** Token(s) and amount(s) to send */
148
+ tokens: TokensPayload[];
149
+ /** Payment description shown to user */
150
+ description: string;
151
+ /** Network (defaults to World Chain) */
152
+ network?: Network;
153
+ }
154
+ interface PayResult {
155
+ /** Transaction hash/ID */
156
+ transactionId: string;
157
+ /** Reference that was passed in */
158
+ reference: string;
159
+ /** From address */
160
+ from: string;
161
+ /** Chain used */
162
+ chain: Network;
163
+ /** Timestamp */
164
+ timestamp: string;
165
+ }
166
+ declare class PayError extends Error {
167
+ readonly code: string;
168
+ constructor(code: string);
169
+ }
170
+
171
+ type RequestPermissionParams = {
172
+ permission: Permission;
173
+ };
174
+ /** @deprecated Use {@link MiniKitRequestPermissionOptions} instead */
175
+ type RequestPermissionInput = RequestPermissionParams;
176
+ declare enum RequestPermissionErrorCodes {
177
+ UserRejected = "user_rejected",
178
+ GenericError = "generic_error",
179
+ AlreadyRequested = "already_requested",
180
+ PermissionDisabled = "permission_disabled",
181
+ AlreadyGranted = "already_granted",
182
+ UnsupportedPermission = "unsupported_permission"
183
+ }
184
+ type MiniAppRequestPermissionSuccessPayload = MiniAppBaseSuccessPayload & {
185
+ permission: Permission;
186
+ timestamp: string;
187
+ };
188
+ type MiniAppRequestPermissionErrorPayload = MiniAppBaseErrorPayload<RequestPermissionErrorCodes> & {
189
+ description: string;
190
+ };
191
+ type MiniAppRequestPermissionPayload = MiniAppRequestPermissionSuccessPayload | MiniAppRequestPermissionErrorPayload;
192
+ interface MiniKitRequestPermissionOptions<TCustomFallback = MiniAppRequestPermissionPayload> extends RequestPermissionParams, FallbackConfig<TCustomFallback> {
193
+ }
194
+ declare class RequestPermissionError extends Error {
195
+ readonly error_code: RequestPermissionErrorCodes;
196
+ constructor(error_code: RequestPermissionErrorCodes);
197
+ }
198
+
199
+ type SendHapticFeedbackParams = {
200
+ hapticsType: 'notification';
201
+ style: 'error' | 'success' | 'warning';
202
+ } | {
203
+ hapticsType: 'selection-changed';
204
+ style?: never;
205
+ } | {
206
+ hapticsType: 'impact';
207
+ style: 'light' | 'medium' | 'heavy';
208
+ };
209
+ /** @deprecated Use {@link MiniKitSendHapticFeedbackOptions} instead */
210
+ type SendHapticFeedbackInput = SendHapticFeedbackParams;
211
+ declare enum SendHapticFeedbackErrorCodes {
212
+ GenericError = "generic_error",
213
+ UserRejected = "user_rejected"
214
+ }
215
+ type MiniAppSendHapticFeedbackSuccessPayload = MiniAppBaseSuccessPayload & {
216
+ timestamp: string;
217
+ };
218
+ type MiniAppSendHapticFeedbackErrorPayload = MiniAppBaseErrorPayload<SendHapticFeedbackErrorCodes>;
219
+ type MiniAppSendHapticFeedbackPayload = MiniAppSendHapticFeedbackSuccessPayload | MiniAppSendHapticFeedbackErrorPayload;
220
+ type MiniKitSendHapticFeedbackOptions<TCustomFallback = MiniAppSendHapticFeedbackPayload> = SendHapticFeedbackParams & FallbackConfig<TCustomFallback>;
221
+ declare class SendHapticFeedbackError extends Error {
222
+ readonly error_code: SendHapticFeedbackErrorCodes;
223
+ constructor(error_code: SendHapticFeedbackErrorCodes);
224
+ }
225
+
226
+ type Permit2 = {
227
+ permitted: {
228
+ token: string;
229
+ amount: string | unknown;
230
+ };
231
+ spender: string;
232
+ nonce: string | unknown;
233
+ deadline: string | unknown;
234
+ };
235
+ type CalldataTransaction = {
236
+ to: string;
237
+ /** Raw calldata hex string */
238
+ data?: string;
239
+ /** Hex encoded value */
240
+ value?: string | undefined;
241
+ };
242
+ /** @deprecated Use {@link CalldataTransaction} in `transactions` */
243
+ type LegacyTransaction = {
244
+ address: string;
245
+ value?: string | undefined;
246
+ /** Raw calldata. If provided, it takes precedence over ABI/functionName/args. */
247
+ data?: string;
248
+ abi?: Abi | readonly unknown[];
249
+ functionName?: ContractFunctionName<Abi | readonly unknown[], 'payable' | 'nonpayable'>;
250
+ args?: ContractFunctionArgs<Abi | readonly unknown[], 'payable' | 'nonpayable', ContractFunctionName<Abi | readonly unknown[], 'payable' | 'nonpayable'>>;
251
+ };
252
+ type ContractFunctionName<abi extends Abi | readonly unknown[] = Abi, mutability extends AbiStateMutability = AbiStateMutability> = ExtractAbiFunctionNames<abi extends Abi ? abi : Abi, mutability> extends infer functionName extends string ? [functionName] extends [never] ? string : functionName : string;
253
+ type ContractFunctionArgs<abi extends Abi | readonly unknown[] = Abi, mutability extends AbiStateMutability = AbiStateMutability, functionName extends ContractFunctionName<abi, mutability> = ContractFunctionName<abi, mutability>> = AbiParametersToPrimitiveTypes<ExtractAbiFunction<abi extends Abi ? abi : Abi, functionName, mutability>['inputs'], 'inputs'> extends infer args ? [args] extends [never] ? readonly unknown[] : args : readonly unknown[];
254
+ /** @deprecated Use {@link CalldataTransaction} */
255
+ type Transaction = LegacyTransaction;
256
+ /** @deprecated sendTransaction v1 payload (legacy) */
257
+ type SendTransactionV1Input = {
258
+ transactions: CalldataTransaction[];
259
+ network: Network;
260
+ permit2?: Permit2[];
261
+ formatPayload?: boolean;
262
+ };
263
+ /** @deprecated sendTransaction v1 payload (legacy) */
264
+ type SendTransactionV1Payload = SendTransactionV1Input;
265
+ /** sendTransaction v2 payload sent to mobile */
266
+ type SendTransactionV2Input = {
267
+ transactions: CalldataTransaction[];
268
+ chainId: number;
269
+ };
270
+ type SendTransactionV2Payload = SendTransactionV2Input;
271
+ /** Current sendTransaction payload */
272
+ type SendTransactionInput = SendTransactionV2Input;
273
+ type SendTransactionPayload = SendTransactionV2Payload;
274
+ declare enum SendTransactionErrorCodes {
275
+ InvalidOperation = "invalid_operation",
276
+ UserRejected = "user_rejected",
277
+ InputError = "input_error",
278
+ SimulationFailed = "simulation_failed",
279
+ TransactionFailed = "transaction_failed",
280
+ GenericError = "generic_error",
281
+ DisallowedOperation = "disallowed_operation",
282
+ ValidationError = "validation_error",
283
+ InvalidContract = "invalid_contract",
284
+ MaliciousOperation = "malicious_operation",
285
+ DailyTxLimitReached = "daily_tx_limit_reached",
286
+ PermittedAmountExceedsSlippage = "permitted_amount_exceeds_slippage",
287
+ PermittedAmountNotFound = "permitted_amount_not_found"
288
+ }
289
+ declare const SendTransactionErrorMessage: Record<SendTransactionErrorCodes, string>;
290
+ /** @deprecated sendTransaction v1 success payload */
291
+ type MiniAppSendTransactionV1SuccessPayload = MiniAppBaseSuccessPayload & {
292
+ transaction_status: 'submitted';
293
+ transaction_id?: string;
294
+ reference?: string;
295
+ from?: string;
296
+ chain: Network;
297
+ timestamp?: string;
298
+ userOpHash?: string;
299
+ mini_app_id?: string;
300
+ };
301
+ /** sendTransaction v2 success payload */
302
+ type MiniAppSendTransactionV2SuccessPayload = MiniAppBaseSuccessPayload & {
303
+ userOpHash: string;
304
+ from: string;
305
+ network: Network;
306
+ timestamp: string;
307
+ };
308
+ type MiniAppSendTransactionSuccessPayload = MiniAppSendTransactionV2SuccessPayload;
309
+ /** @deprecated sendTransaction v1 error payload */
310
+ type MiniAppSendTransactionV1ErrorPayload = MiniAppBaseErrorPayload<SendTransactionErrorCodes> & {
311
+ details?: Record<string, any>;
312
+ mini_app_id?: string;
313
+ };
314
+ /** sendTransaction v2 error payload */
315
+ type MiniAppSendTransactionV2ErrorPayload = MiniAppBaseErrorPayload<SendTransactionErrorCodes> & {
316
+ details?: Record<string, any>;
317
+ };
318
+ type MiniAppSendTransactionErrorPayload = MiniAppSendTransactionV2ErrorPayload;
319
+ /** @deprecated sendTransaction v1 payload */
320
+ type MiniAppSendTransactionV1Payload = MiniAppSendTransactionV1SuccessPayload | MiniAppSendTransactionV1ErrorPayload;
321
+ /** sendTransaction v2 payload */
322
+ type MiniAppSendTransactionV2Payload = MiniAppSendTransactionV2SuccessPayload | MiniAppSendTransactionV2ErrorPayload;
323
+ type MiniAppSendTransactionPayload = MiniAppSendTransactionV2Payload;
324
+ interface MiniKitSendTransactionOptions<TCustomFallback = SendTransactionResult> extends FallbackConfig<TCustomFallback> {
325
+ /** Transactions to execute (calldata first) */
326
+ transactions: CalldataTransaction[];
327
+ /** Chain ID to execute on */
328
+ chainId: number;
329
+ }
330
+ /** @deprecated sendTransaction v1 options (legacy) */
331
+ interface MiniKitSendTransactionV1Options<TCustomFallback = SendTransactionResult> extends FallbackConfig<TCustomFallback> {
332
+ transactions?: CalldataTransaction[];
333
+ transaction?: LegacyTransaction[];
334
+ network?: Network;
335
+ chainId?: number;
336
+ permit2?: Permit2[];
337
+ formatPayload?: boolean;
338
+ }
339
+ /** sendTransaction v2 options */
340
+ type MiniKitSendTransactionV2Options<TCustomFallback = SendTransactionResult> = MiniKitSendTransactionOptions<TCustomFallback>;
341
+ /** @deprecated sendTransaction v1 result shape */
342
+ interface SendTransactionV1Result {
343
+ transactionHash?: string | null;
344
+ userOpHash?: string | null;
345
+ mini_app_id?: string | null;
346
+ status?: 'success' | null;
347
+ version?: number | null;
348
+ transactionId?: string | null;
349
+ reference?: string | null;
350
+ from?: string | null;
351
+ chain?: string | null;
352
+ timestamp?: string | null;
353
+ transaction_id?: string | null;
354
+ transaction_status?: 'submitted';
355
+ }
356
+ /** sendTransaction v2 result shape */
357
+ interface SendTransactionV2Result {
358
+ /** User operation hash (or tx hash in web fallback) */
359
+ userOpHash: string;
360
+ /** Result status */
361
+ status: 'success';
362
+ /** Payload version */
363
+ version: number;
364
+ /** From address */
365
+ from: string;
366
+ /** Timestamp */
367
+ timestamp: string;
368
+ }
369
+ type SendTransactionResult = SendTransactionV2Result;
370
+ interface FeatureSupport {
371
+ /** Whether batch transactions are supported */
372
+ batch: boolean;
373
+ /** Whether Permit2 is supported */
374
+ permit2: boolean;
375
+ /** Whether gas sponsorship is available */
376
+ gasSponsorship: boolean;
377
+ }
378
+ declare const WORLD_APP_FEATURES: FeatureSupport;
379
+ declare const WEB_FEATURES: FeatureSupport;
380
+ declare class SendTransactionError extends Error {
381
+ readonly code: string;
382
+ readonly details?: Record<string, unknown>;
383
+ constructor(code: string, details?: Record<string, unknown>);
384
+ }
385
+
386
+ type ShareParams = {
387
+ files?: File[];
388
+ title?: string;
389
+ text?: string;
390
+ url?: string;
391
+ };
392
+ /** @deprecated Use {@link MiniKitShareOptions} instead */
393
+ type ShareInput = ShareParams;
394
+ interface MiniKitShareOptions<TCustomFallback = MiniAppSharePayload> extends ShareParams, FallbackConfig<TCustomFallback> {
395
+ }
396
+ type SharePayload = {
397
+ files?: Array<{
398
+ name: string;
399
+ type: string;
400
+ data: string;
401
+ }>;
402
+ title?: string;
403
+ text?: string;
404
+ url?: string;
405
+ };
406
+ declare enum ShareFilesErrorCodes {
407
+ UserRejected = "user_rejected",
408
+ GenericError = "generic_error",
409
+ InvalidFileName = "invalid_file_name"
410
+ }
411
+ type MiniAppShareSuccessPayload = MiniAppBaseSuccessPayload & {
412
+ shared_files_count: number;
413
+ timestamp: string;
414
+ };
415
+ type MiniAppShareErrorPayload = MiniAppBaseErrorPayload<ShareFilesErrorCodes>;
416
+ type MiniAppSharePayload = MiniAppShareSuccessPayload | MiniAppShareErrorPayload;
417
+ declare class ShareError extends Error {
418
+ readonly error_code: ShareFilesErrorCodes;
419
+ constructor(error_code: ShareFilesErrorCodes);
420
+ }
421
+
422
+ type ShareContactsParams = {
423
+ isMultiSelectEnabled: boolean;
424
+ inviteMessage?: string;
425
+ };
426
+ /** @deprecated Use {@link MiniKitShareContactsOptions} instead */
427
+ type ShareContactsInput = ShareContactsParams;
428
+ /** @deprecated Use {@link MiniKitShareContactsOptions} instead */
429
+ type ShareContactsPayload = ShareContactsInput;
430
+ declare enum ShareContactsErrorCodes {
431
+ UserRejected = "user_rejected",
432
+ GenericError = "generic_error"
433
+ }
434
+ declare const ShareContactsErrorMessage: {
435
+ user_rejected: string;
436
+ generic_error: string;
437
+ };
438
+ type Contact = {
439
+ username: string;
440
+ walletAddress: string;
441
+ profilePictureUrl: string | null;
442
+ };
443
+ type MiniAppShareContactsSuccessPayload = MiniAppBaseSuccessPayload & {
444
+ contacts: Contact[];
445
+ timestamp: string;
446
+ };
447
+ type MiniAppShareContactsErrorPayload = MiniAppBaseErrorPayload<ShareContactsErrorCodes>;
448
+ type MiniAppShareContactsPayload = MiniAppShareContactsSuccessPayload | MiniAppShareContactsErrorPayload;
449
+ interface MiniKitShareContactsOptions<TCustomFallback = ShareContactsResult> extends FallbackConfig<TCustomFallback> {
450
+ /** Enable multi-select in the contact picker */
451
+ isMultiSelectEnabled?: boolean;
452
+ /** Custom invite message for sharing */
453
+ inviteMessage?: string;
454
+ }
455
+ interface ShareContactsResult {
456
+ /** Selected contacts */
457
+ contacts: Contact[];
458
+ /** Timestamp */
459
+ timestamp: string;
460
+ }
461
+ declare class ShareContactsError extends Error {
462
+ readonly code: string;
463
+ constructor(code: string);
464
+ }
465
+
466
+ type SignMessageParams = {
467
+ message: string;
468
+ };
469
+ /** @deprecated Use {@link MiniKitSignMessageOptions} instead */
470
+ type SignMessageInput = SignMessageParams;
471
+ interface MiniKitSignMessageOptions<TCustomFallback = MiniAppSignMessageSuccessPayload> extends SignMessageParams, FallbackConfig<TCustomFallback> {
472
+ }
473
+ declare enum SignMessageErrorCodes {
474
+ InvalidMessage = "invalid_message",
475
+ UserRejected = "user_rejected",
476
+ GenericError = "generic_error"
477
+ }
478
+ type MiniAppSignMessageSuccessPayload = MiniAppBaseSuccessPayload & {
479
+ signature: string;
480
+ address: string;
481
+ };
482
+ type MiniAppSignMessageErrorPayload = MiniAppBaseErrorPayload<SignMessageErrorCodes> & {
483
+ details?: Record<string, any>;
484
+ };
485
+ type MiniAppSignMessagePayload = MiniAppSignMessageSuccessPayload | MiniAppSignMessageErrorPayload;
486
+ declare class SignMessageError extends Error {
487
+ readonly error_code: SignMessageErrorCodes;
488
+ constructor(error_code: SignMessageErrorCodes);
489
+ }
490
+
491
+ type SignTypedDataParams = {
492
+ types: TypedData;
493
+ primaryType: string;
494
+ message: Record<string, unknown>;
495
+ domain?: TypedDataDomain;
496
+ chainId?: number;
497
+ };
498
+ /** @deprecated Use {@link MiniKitSignTypedDataOptions} instead */
499
+ type SignTypedDataInput = SignTypedDataParams;
500
+ interface MiniKitSignTypedDataOptions<TCustomFallback = MiniAppSignTypedDataPayload> extends SignTypedDataParams, FallbackConfig<TCustomFallback> {
501
+ }
502
+ declare enum SignTypedDataErrorCodes {
503
+ InvalidOperation = "invalid_operation",
504
+ UserRejected = "user_rejected",
505
+ InputError = "input_error",
506
+ SimulationFailed = "simulation_failed",
507
+ GenericError = "generic_error",
508
+ DisallowedOperation = "disallowed_operation",
509
+ InvalidContract = "invalid_contract",
510
+ MaliciousOperation = "malicious_operation"
511
+ }
512
+ type MiniAppSignTypedDataSuccessPayload = MiniAppBaseSuccessPayload & {
513
+ signature: string;
514
+ address: string;
515
+ };
516
+ type MiniAppSignTypedDataErrorPayload = MiniAppBaseErrorPayload<SignTypedDataErrorCodes> & {
517
+ details?: Record<string, any>;
518
+ };
519
+ type MiniAppSignTypedDataPayload = MiniAppSignTypedDataSuccessPayload | MiniAppSignTypedDataErrorPayload;
520
+ declare class SignTypedDataError extends Error {
521
+ readonly error_code: SignTypedDataErrorCodes;
522
+ constructor(error_code: SignTypedDataErrorCodes);
523
+ }
524
+
525
+ export { type MiniAppPaymentErrorPayload as $, type AttestationInput as A, AttestationErrorCodes as B, type CloseMiniAppResult as C, type MiniAppAttestationErrorPayload as D, type MiniAppAttestationPayload as E, AttestationError as F, type ChatInput as G, ChatErrorCodes as H, type MiniAppChatErrorPayload as I, ChatError as J, GetPermissionsErrorCodes as K, Permission as L, type MiniKitSendTransactionOptions as M, type PermissionSettings as N, type MiniAppGetPermissionsErrorPayload as O, type PayResult as P, GetPermissionsError as Q, TokenDecimals as R, type SendTransactionResult as S, Tokens as T, Network as U, type TokensPayload as V, type PayCommandInput as W, type PayCommandPayload as X, PaymentErrorCodes as Y, PaymentErrorMessage as Z, type MiniAppPaymentSuccessPayload as _, type MiniKitPayOptions as a, SignTypedDataError as a$, type MiniAppPaymentPayload as a0, PayError as a1, type RequestPermissionInput as a2, RequestPermissionErrorCodes as a3, type MiniAppRequestPermissionErrorPayload as a4, RequestPermissionError as a5, type SendHapticFeedbackInput as a6, SendHapticFeedbackErrorCodes as a7, type MiniAppSendHapticFeedbackErrorPayload as a8, SendHapticFeedbackError as a9, type SendTransactionV2Result as aA, type FeatureSupport as aB, WORLD_APP_FEATURES as aC, WEB_FEATURES as aD, SendTransactionError as aE, type ShareInput as aF, type SharePayload as aG, ShareFilesErrorCodes as aH, type MiniAppShareErrorPayload as aI, ShareError as aJ, type ShareContactsInput as aK, type ShareContactsPayload as aL, ShareContactsErrorCodes as aM, ShareContactsErrorMessage as aN, type Contact as aO, type MiniAppShareContactsSuccessPayload as aP, type MiniAppShareContactsErrorPayload as aQ, type MiniAppShareContactsPayload as aR, ShareContactsError as aS, type SignMessageInput as aT, SignMessageErrorCodes as aU, type MiniAppSignMessageErrorPayload as aV, type MiniAppSignMessagePayload as aW, SignMessageError as aX, type SignTypedDataInput as aY, SignTypedDataErrorCodes as aZ, type MiniAppSignTypedDataErrorPayload as a_, type Permit2 as aa, type CalldataTransaction as ab, type LegacyTransaction as ac, type ContractFunctionName as ad, type ContractFunctionArgs as ae, type Transaction as af, type SendTransactionV1Input as ag, type SendTransactionV1Payload as ah, type SendTransactionV2Input as ai, type SendTransactionV2Payload as aj, type SendTransactionInput as ak, type SendTransactionPayload as al, SendTransactionErrorCodes as am, SendTransactionErrorMessage as an, type MiniAppSendTransactionV1SuccessPayload as ao, type MiniAppSendTransactionV2SuccessPayload as ap, type MiniAppSendTransactionSuccessPayload as aq, type MiniAppSendTransactionV1ErrorPayload as ar, type MiniAppSendTransactionV2ErrorPayload as as, type MiniAppSendTransactionErrorPayload as at, type MiniAppSendTransactionV1Payload as au, type MiniAppSendTransactionV2Payload as av, type MiniAppSendTransactionPayload as aw, type MiniKitSendTransactionV1Options as ax, type MiniKitSendTransactionV2Options as ay, type SendTransactionV1Result as az, type ShareContactsResult as b, type MiniKitShareContactsOptions as c, type MiniAppSignMessageSuccessPayload as d, type MiniKitSignMessageOptions as e, type MiniAppSignTypedDataPayload as f, type MiniKitSignTypedDataOptions as g, type MiniAppSignTypedDataSuccessPayload as h, type MiniAppChatPayload as i, type MiniKitChatOptions as j, type MiniAppChatSuccessPayload as k, type MiniAppSharePayload as l, type MiniKitShareOptions as m, type MiniAppShareSuccessPayload as n, type MiniAppGetPermissionsPayload as o, type MiniKitGetPermissionsOptions as p, type MiniAppGetPermissionsSuccessPayload as q, type MiniAppRequestPermissionPayload as r, type MiniKitRequestPermissionOptions as s, type MiniAppRequestPermissionSuccessPayload as t, type MiniAppSendHapticFeedbackPayload as u, type MiniKitSendHapticFeedbackOptions as v, type MiniAppSendHapticFeedbackSuccessPayload as w, type MiniAppAttestationSuccessPayload as x, type MiniKitAttestationOptions as y, type MiniKitCloseMiniAppOptions as z };