@worldcoin/minikit-js 1.7.1 → 1.9.0

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.js CHANGED
@@ -1,1074 +1,50 @@
1
- // minikit.ts
2
- import { VerificationLevel } from "@worldcoin/idkit-core";
3
- import { encodeAction, generateSignal } from "@worldcoin/idkit-core/hashing";
4
-
5
- // types/payment.ts
6
- var Tokens = /* @__PURE__ */ ((Tokens3) => {
7
- Tokens3["USDCE"] = "USDCE";
8
- Tokens3["WLD"] = "WLD";
9
- return Tokens3;
10
- })(Tokens || {});
11
- var TokenDecimals = {
12
- ["USDCE" /* USDCE */]: 6,
13
- ["WLD" /* WLD */]: 18
14
- };
15
- var Network = /* @__PURE__ */ ((Network2) => {
16
- Network2["Optimism"] = "optimism";
17
- Network2["WorldChain"] = "worldchain";
18
- return Network2;
19
- })(Network || {});
20
-
21
- // helpers/payment/client.ts
22
- var tokenToDecimals = (amount, token) => {
23
- const decimals = TokenDecimals[token];
24
- if (decimals === void 0) {
25
- throw new Error(`Invalid token: ${token}`);
26
- }
27
- const factor = 10 ** decimals;
28
- const result = amount * factor;
29
- if (!Number.isInteger(result)) {
30
- throw new Error(`The resulting amount is not a whole number: ${result}`);
31
- }
32
- return result;
33
- };
34
- var validatePaymentPayload = (payload) => {
35
- if (payload.tokens.some(
36
- (token) => token.symbol == "USDCE" && parseFloat(token.token_amount) < 0.1
37
- )) {
38
- console.error("USDCE amount should be greater than $0.1");
39
- return false;
40
- }
41
- if (payload.reference.length > 36) {
42
- console.error("Reference must not exceed 36 characters");
43
- return false;
44
- }
45
- if (typeof payload.reference !== "string") {
46
- throw new Error("Reference must be a string");
47
- }
48
- return true;
49
- };
50
-
51
- // helpers/siwe/siwe.ts
52
1
  import {
53
- createPublicClient,
54
- getContract,
55
- hashMessage,
56
- http,
57
- recoverAddress
58
- } from "viem";
59
- import { worldchain } from "viem/chains";
60
- var PREAMBLE = " wants you to sign in with your Ethereum account:";
61
- var URI_TAG = "URI: ";
62
- var VERSION_TAG = "Version: ";
63
- var CHAIN_TAG = "Chain ID: ";
64
- var NONCE_TAG = "Nonce: ";
65
- var IAT_TAG = "Issued At: ";
66
- var EXP_TAG = "Expiration Time: ";
67
- var NBF_TAG = "Not Before: ";
68
- var RID_TAG = "Request ID: ";
69
- var ERC_191_PREFIX = "Ethereum Signed Message:\n";
70
- var tagged = (line, tag) => {
71
- if (line && line.includes(tag)) {
72
- return line.replace(tag, "");
73
- } else {
74
- throw new Error(`Missing '${tag}'`);
75
- }
76
- };
77
- var parseSiweMessage = (inputString) => {
78
- const lines = inputString.split("\n")[Symbol.iterator]();
79
- const domain = tagged(lines.next()?.value, PREAMBLE);
80
- const address = lines.next()?.value;
81
- lines.next();
82
- const nextValue = lines.next()?.value;
83
- let statement;
84
- if (nextValue) {
85
- statement = nextValue;
86
- lines.next();
87
- }
88
- const uri = tagged(lines.next()?.value, URI_TAG);
89
- const version = tagged(lines.next()?.value, VERSION_TAG);
90
- const chain_id = tagged(lines.next()?.value, CHAIN_TAG);
91
- const nonce = tagged(lines.next()?.value, NONCE_TAG);
92
- const issued_at = tagged(lines.next()?.value, IAT_TAG);
93
- let expiration_time, not_before, request_id;
94
- for (let line of lines) {
95
- if (line.startsWith(EXP_TAG)) {
96
- expiration_time = tagged(line, EXP_TAG);
97
- } else if (line.startsWith(NBF_TAG)) {
98
- not_before = tagged(line, NBF_TAG);
99
- } else if (line.startsWith(RID_TAG)) {
100
- request_id = tagged(line, RID_TAG);
101
- }
102
- }
103
- if (lines.next().done === false) {
104
- throw new Error("Extra lines in the input");
105
- }
106
- const siweMessageData = {
107
- domain,
108
- address,
109
- statement,
110
- uri,
111
- version,
112
- chain_id,
113
- nonce,
114
- issued_at,
115
- expiration_time,
116
- not_before,
117
- request_id
118
- };
119
- return siweMessageData;
120
- };
121
- var generateSiweMessage = (siweMessageData) => {
122
- let siweMessage = "";
123
- if (siweMessageData.scheme) {
124
- siweMessage += `${siweMessageData.scheme}://${siweMessageData.domain} wants you to sign in with your Ethereum account:
125
- `;
126
- } else {
127
- siweMessage += `${siweMessageData.domain} wants you to sign in with your Ethereum account:
128
- `;
129
- }
130
- if (siweMessageData.address) {
131
- siweMessage += `${siweMessageData.address}
132
- `;
133
- } else {
134
- siweMessage += "{address}\n";
135
- }
136
- siweMessage += "\n";
137
- if (siweMessageData.statement) {
138
- siweMessage += `${siweMessageData.statement}
139
- `;
140
- }
141
- siweMessage += "\n";
142
- siweMessage += `URI: ${siweMessageData.uri}
143
- `;
144
- siweMessage += `Version: ${siweMessageData.version}
145
- `;
146
- siweMessage += `Chain ID: ${siweMessageData.chain_id}
147
- `;
148
- siweMessage += `Nonce: ${siweMessageData.nonce}
149
- `;
150
- siweMessage += `Issued At: ${siweMessageData.issued_at}
151
- `;
152
- if (siweMessageData.expiration_time) {
153
- siweMessage += `Expiration Time: ${siweMessageData.expiration_time}
154
- `;
155
- }
156
- if (siweMessageData.not_before) {
157
- siweMessage += `Not Before: ${siweMessageData.not_before}
158
- `;
159
- }
160
- if (siweMessageData.request_id) {
161
- siweMessage += `Request ID: ${siweMessageData.request_id}
162
- `;
163
- }
164
- return siweMessage;
165
- };
166
- var SAFE_CONTRACT_ABI = [
167
- {
168
- inputs: [
169
- {
170
- internalType: "address",
171
- name: "owner",
172
- type: "address"
173
- }
174
- ],
175
- name: "isOwner",
176
- outputs: [
177
- {
178
- internalType: "bool",
179
- name: "",
180
- type: "bool"
181
- }
182
- ],
183
- stateMutability: "view",
184
- type: "function"
185
- }
186
- ];
187
- var verifySiweMessage = async (payload, nonce, statement, requestId, userProvider) => {
188
- if (typeof window !== "undefined") {
189
- throw new Error("Verify can only be called in the backend");
190
- }
191
- const { message, signature, address } = payload;
192
- const siweMessageData = parseSiweMessage(message);
193
- if (siweMessageData.expiration_time) {
194
- const expirationTime = new Date(siweMessageData.expiration_time);
195
- if (expirationTime < /* @__PURE__ */ new Date()) {
196
- throw new Error("Expired message");
197
- }
198
- }
199
- if (siweMessageData.not_before) {
200
- const notBefore = new Date(siweMessageData.not_before);
201
- if (notBefore > /* @__PURE__ */ new Date()) {
202
- throw new Error("Not Before time has not passed");
203
- }
204
- }
205
- if (nonce && siweMessageData.nonce !== nonce) {
206
- throw new Error(
207
- `Nonce mismatch. Got: ${siweMessageData.nonce}, Expected: ${nonce}`
208
- );
209
- }
210
- if (statement && siweMessageData.statement !== statement) {
211
- throw new Error(
212
- `Statement mismatch. Got: ${siweMessageData.statement}, Expected: ${statement}`
213
- );
214
- }
215
- if (requestId && siweMessageData.request_id !== requestId) {
216
- throw new Error(
217
- `Request ID mismatch. Got: ${siweMessageData.request_id}, Expected: ${requestId}`
218
- );
219
- }
220
- let provider = userProvider || createPublicClient({ chain: worldchain, transport: http() });
221
- const signedMessage = `${ERC_191_PREFIX}${message.length}${message}`;
222
- const hashedMessage = hashMessage(signedMessage);
223
- const contract = getContract({
224
- address,
225
- abi: SAFE_CONTRACT_ABI,
226
- client: provider
227
- });
228
- try {
229
- const recoveredAddress = await recoverAddress({
230
- hash: hashedMessage,
231
- signature: `0x${signature}`
232
- });
233
- const isOwner = await contract.read.isOwner([recoveredAddress]);
234
- if (!isOwner) {
235
- throw new Error("Signature verification failed, invalid owner");
236
- }
237
- } catch (error) {
238
- throw new Error("Signature verification failed");
239
- }
240
- return { isValid: true, siweMessageData };
241
- };
242
-
243
- // helpers/siwe/validate-wallet-auth-command-input.ts
244
- var validateWalletAuthCommandInput = (params) => {
245
- if (!params.nonce) {
246
- return { valid: false, message: "'nonce' is required" };
247
- }
248
- if (params.nonce.length < 8) {
249
- return { valid: false, message: "'nonce' must be at least 8 characters" };
250
- }
251
- if (params.statement && params.statement.includes("\n")) {
252
- return { valid: false, message: "'statement' must not contain newlines" };
253
- }
254
- if (params.expirationTime && new Date(params.expirationTime) < /* @__PURE__ */ new Date()) {
255
- return { valid: false, message: "'expirationTime' must be in the future" };
256
- }
257
- if (params.expirationTime && new Date(params.expirationTime) > new Date(Date.now() + 7 * 24 * 60 * 60 * 1e3)) {
258
- return { valid: false, message: "'expirationTime' must be within 7 days" };
259
- }
260
- if (params.notBefore && new Date(params.notBefore) > new Date(Date.now() + 7 * 24 * 60 * 60 * 1e3)) {
261
- return { valid: false, message: "'notBefore' must be within 7 days" };
262
- }
263
- return { valid: true };
264
- };
265
-
266
- // helpers/transaction/validate-payload.ts
267
- var isValidHex = (str) => {
268
- return /^0x[0-9A-Fa-f]+$/.test(str);
269
- };
270
- var processPayload = (payload) => {
271
- if (typeof payload === "boolean" || typeof payload === "string" || payload === null || payload === void 0) {
272
- return payload;
273
- }
274
- if (typeof payload === "number") {
275
- return String(payload);
276
- }
277
- if (Array.isArray(payload)) {
278
- return payload.map((value) => processPayload(value));
279
- }
280
- if (typeof payload === "object") {
281
- const result = { ...payload };
282
- if ("value" in result && result.value !== void 0) {
283
- if (typeof result.value !== "string") {
284
- result.value = String(result.value);
285
- }
286
- if (!isValidHex(result.value)) {
287
- console.error(
288
- "Transaction value must be a valid hex string",
289
- result.value
290
- );
291
- throw new Error(
292
- `Transaction value must be a valid hex string: ${result.value}`
293
- );
294
- }
295
- }
296
- for (const key in result) {
297
- if (Object.prototype.hasOwnProperty.call(result, key)) {
298
- result[key] = processPayload(result[key]);
299
- }
300
- }
301
- return result;
302
- }
303
- return payload;
304
- };
305
- var validateSendTransactionPayload = (payload) => {
306
- return processPayload(payload);
307
- };
308
-
309
- // helpers/usernames/index.ts
310
- var getUserProfile = async (address) => {
311
- const res = await fetch("https://usernames.worldcoin.org/api/v1/query", {
312
- method: "POST",
313
- headers: {
314
- "Content-Type": "application/json"
315
- },
316
- body: JSON.stringify({
317
- addresses: [address]
318
- })
319
- });
320
- const usernames = await res.json();
321
- return usernames?.[0] ?? { username: null, profilePictureUrl: null };
322
- };
323
-
324
- // types/commands.ts
325
- var Command = /* @__PURE__ */ ((Command2) => {
326
- Command2["Verify"] = "verify";
327
- Command2["Pay"] = "pay";
328
- Command2["WalletAuth"] = "wallet-auth";
329
- Command2["SendTransaction"] = "send-transaction";
330
- Command2["SignMessage"] = "sign-message";
331
- Command2["SignTypedData"] = "sign-typed-data";
332
- Command2["ShareContacts"] = "share-contacts";
333
- Command2["RequestPermission"] = "request-permission";
334
- Command2["GetPermissions"] = "get-permissions";
335
- Command2["SendHapticFeedback"] = "send-haptic-feedback";
336
- return Command2;
337
- })(Command || {});
338
- var Permission = /* @__PURE__ */ ((Permission2) => {
339
- Permission2["Notifications"] = "notifications";
340
- return Permission2;
341
- })(Permission || {});
342
-
343
- // types/errors.ts
344
- import { AppErrorCodes } from "@worldcoin/idkit-core";
345
- import { AppErrorCodes as AppErrorCodes2 } from "@worldcoin/idkit-core";
346
- var VerificationErrorMessage = {
347
- [AppErrorCodes.VerificationRejected]: "You've cancelled the request in World App.",
348
- [AppErrorCodes.MaxVerificationsReached]: "You have already verified the maximum number of times for this action.",
349
- [AppErrorCodes.CredentialUnavailable]: "It seems you do not have the verification level required by this app.",
350
- [AppErrorCodes.MalformedRequest]: "There was a problem with this request. Please try again or contact the app owner.",
351
- [AppErrorCodes.InvalidNetwork]: "Invalid network. If you are the app owner, visit docs.worldcoin.org/test for details.",
352
- [AppErrorCodes.InclusionProofFailed]: "There was an issue fetching your credential. Please try again.",
353
- [AppErrorCodes.InclusionProofPending]: "Your identity is still being registered. Please wait a few minutes and try again.",
354
- [AppErrorCodes.UnexpectedResponse]: "Unexpected response from your wallet. Please try again.",
355
- [AppErrorCodes.FailedByHostApp]: "Verification failed by the app. Please contact the app owner for details.",
356
- [AppErrorCodes.GenericError]: "Something unexpected went wrong. Please try again.",
357
- [AppErrorCodes.ConnectionFailed]: "Connection to your wallet failed. Please try again."
358
- };
359
- var PaymentErrorCodes = /* @__PURE__ */ ((PaymentErrorCodes2) => {
360
- PaymentErrorCodes2["InputError"] = "input_error";
361
- PaymentErrorCodes2["PaymentRejected"] = "payment_rejected";
362
- PaymentErrorCodes2["InvalidReceiver"] = "invalid_receiver";
363
- PaymentErrorCodes2["InsufficientBalance"] = "insufficient_balance";
364
- PaymentErrorCodes2["TransactionFailed"] = "transaction_failed";
365
- PaymentErrorCodes2["GenericError"] = "generic_error";
366
- PaymentErrorCodes2["UserBlocked"] = "user_blocked";
367
- return PaymentErrorCodes2;
368
- })(PaymentErrorCodes || {});
369
- var PaymentErrorMessage = {
370
- ["input_error" /* InputError */]: "There was a problem with this request. Please try again or contact the app owner.",
371
- ["payment_rejected" /* PaymentRejected */]: "You've cancelled the payment in World App.",
372
- ["invalid_receiver" /* InvalidReceiver */]: "The receiver address is invalid. Please contact the app owner.",
373
- ["insufficient_balance" /* InsufficientBalance */]: "You do not have enough balance to complete this transaction.",
374
- ["transaction_failed" /* TransactionFailed */]: "The transaction failed. Please try again.",
375
- ["generic_error" /* GenericError */]: "Something unexpected went wrong. Please try again.",
376
- ["user_blocked" /* UserBlocked */]: "User's region is blocked from making payments."
377
- };
378
- var PaymentValidationErrors = /* @__PURE__ */ ((PaymentValidationErrors2) => {
379
- PaymentValidationErrors2["MalformedRequest"] = "There was a problem with this request. Please try again or contact the app owner.";
380
- PaymentValidationErrors2["InvalidTokenAddress"] = "The token address is invalid. Please contact the app owner.";
381
- PaymentValidationErrors2["InvalidAppId"] = "The app ID is invalid. Please contact the app owner.";
382
- PaymentValidationErrors2["DuplicateReference"] = "This reference ID already exists please generate a new one and try again.";
383
- return PaymentValidationErrors2;
384
- })(PaymentValidationErrors || {});
385
- var WalletAuthErrorCodes = /* @__PURE__ */ ((WalletAuthErrorCodes2) => {
386
- WalletAuthErrorCodes2["MalformedRequest"] = "malformed_request";
387
- WalletAuthErrorCodes2["UserRejected"] = "user_rejected";
388
- WalletAuthErrorCodes2["GenericError"] = "generic_error";
389
- return WalletAuthErrorCodes2;
390
- })(WalletAuthErrorCodes || {});
391
- var WalletAuthErrorMessage = {
392
- ["malformed_request" /* MalformedRequest */]: "Provided parameters in the request are invalid.",
393
- ["user_rejected" /* UserRejected */]: "User rejected the request.",
394
- ["generic_error" /* GenericError */]: "Something unexpected went wrong."
395
- };
396
- var SendTransactionErrorCodes = /* @__PURE__ */ ((SendTransactionErrorCodes2) => {
397
- SendTransactionErrorCodes2["InvalidOperation"] = "invalid_operation";
398
- SendTransactionErrorCodes2["UserRejected"] = "user_rejected";
399
- SendTransactionErrorCodes2["InputError"] = "input_error";
400
- SendTransactionErrorCodes2["SimulationFailed"] = "simulation_failed";
401
- SendTransactionErrorCodes2["TransactionFailed"] = "transaction_failed";
402
- SendTransactionErrorCodes2["GenericError"] = "generic_error";
403
- SendTransactionErrorCodes2["DisallowedOperation"] = "disallowed_operation";
404
- SendTransactionErrorCodes2["InvalidContract"] = "invalid_contract";
405
- SendTransactionErrorCodes2["MaliciousOperation"] = "malicious_operation";
406
- SendTransactionErrorCodes2["DailyTxLimitReached"] = "daily_tx_limit_reached";
407
- SendTransactionErrorCodes2["PermittedAmountExceedsSlippage"] = "permitted_amount_exceeds_slippage";
408
- SendTransactionErrorCodes2["PermittedAmountNotFound"] = "permitted_amount_not_found";
409
- return SendTransactionErrorCodes2;
410
- })(SendTransactionErrorCodes || {});
411
- var SendTransactionErrorMessage = {
412
- ["invalid_operation" /* InvalidOperation */]: "Transaction included an operation that was invalid",
413
- ["user_rejected" /* UserRejected */]: "User rejected the request.",
414
- ["input_error" /* InputError */]: "Invalid payload.",
415
- ["simulation_failed" /* SimulationFailed */]: "The transaction simulation failed.",
416
- ["transaction_failed" /* TransactionFailed */]: "The transaction failed. Please try again later.",
417
- ["generic_error" /* GenericError */]: "Something unexpected went wrong. Please try again.",
418
- ["disallowed_operation" /* DisallowedOperation */]: "The operation requested is not allowed. Please refer to the docs.",
419
- ["invalid_contract" /* InvalidContract */]: "The contract address is not allowed for your application. Please check your developer portal configurations",
420
- ["malicious_operation" /* MaliciousOperation */]: "The operation requested is considered malicious.",
421
- ["daily_tx_limit_reached" /* DailyTxLimitReached */]: "Daily transaction limit reached. Max 100 transactions per day. Wait until the next day.",
422
- ["permitted_amount_exceeds_slippage" /* PermittedAmountExceedsSlippage */]: "Permitted amount exceeds slippage. You must spend at least 90% of the permitted amount.",
423
- ["permitted_amount_not_found" /* PermittedAmountNotFound */]: "Permitted amount not found in permit2 payload."
424
- };
425
- var SignMessageErrorCodes = /* @__PURE__ */ ((SignMessageErrorCodes2) => {
426
- SignMessageErrorCodes2["InvalidMessage"] = "invalid_message";
427
- SignMessageErrorCodes2["UserRejected"] = "user_rejected";
428
- SignMessageErrorCodes2["GenericError"] = "generic_error";
429
- return SignMessageErrorCodes2;
430
- })(SignMessageErrorCodes || {});
431
- var SignMessageErrorMessage = {
432
- ["invalid_message" /* InvalidMessage */]: "Invalid message requested",
433
- ["user_rejected" /* UserRejected */]: "User rejected the request.",
434
- ["generic_error" /* GenericError */]: "Something unexpected went wrong."
435
- };
436
- var SignTypedDataErrorCodes = /* @__PURE__ */ ((SignTypedDataErrorCodes2) => {
437
- SignTypedDataErrorCodes2["InvalidOperation"] = "invalid_operation";
438
- SignTypedDataErrorCodes2["UserRejected"] = "user_rejected";
439
- SignTypedDataErrorCodes2["InputError"] = "input_error";
440
- SignTypedDataErrorCodes2["SimulationFailed"] = "simulation_failed";
441
- SignTypedDataErrorCodes2["GenericError"] = "generic_error";
442
- SignTypedDataErrorCodes2["DisallowedOperation"] = "disallowed_operation";
443
- SignTypedDataErrorCodes2["InvalidContract"] = "invalid_contract";
444
- SignTypedDataErrorCodes2["MaliciousOperation"] = "malicious_operation";
445
- return SignTypedDataErrorCodes2;
446
- })(SignTypedDataErrorCodes || {});
447
- var SignTypedDataErrorMessage = {
448
- ["invalid_operation" /* InvalidOperation */]: "Transaction included an operation that was invalid",
449
- ["user_rejected" /* UserRejected */]: "User rejected the request.",
450
- ["input_error" /* InputError */]: "Invalid payload.",
451
- ["simulation_failed" /* SimulationFailed */]: "The transaction simulation failed.",
452
- ["generic_error" /* GenericError */]: "Something unexpected went wrong. Please try again.",
453
- ["disallowed_operation" /* DisallowedOperation */]: "The operation requested is not allowed. Please refer to the docs.",
454
- ["invalid_contract" /* InvalidContract */]: "The contract address is not allowed for your application. Please check your developer portal configurations",
455
- ["malicious_operation" /* MaliciousOperation */]: "The operation requested is considered malicious."
456
- };
457
- var MiniKitInstallErrorCodes = /* @__PURE__ */ ((MiniKitInstallErrorCodes2) => {
458
- MiniKitInstallErrorCodes2["Unknown"] = "unknown";
459
- MiniKitInstallErrorCodes2["AlreadyInstalled"] = "already_installed";
460
- MiniKitInstallErrorCodes2["OutsideOfWorldApp"] = "outside_of_worldapp";
461
- MiniKitInstallErrorCodes2["NotOnClient"] = "not_on_client";
462
- MiniKitInstallErrorCodes2["AppOutOfDate"] = "app_out_of_date";
463
- return MiniKitInstallErrorCodes2;
464
- })(MiniKitInstallErrorCodes || {});
465
- var MiniKitInstallErrorMessage = {
466
- ["unknown" /* Unknown */]: "Failed to install MiniKit.",
467
- ["already_installed" /* AlreadyInstalled */]: "MiniKit is already installed.",
468
- ["outside_of_worldapp" /* OutsideOfWorldApp */]: "MiniApp launched outside of WorldApp.",
469
- ["not_on_client" /* NotOnClient */]: "Window object is not available.",
470
- ["app_out_of_date" /* AppOutOfDate */]: "WorldApp is out of date. Please update the app."
471
- };
472
- var ShareContactsErrorCodes = /* @__PURE__ */ ((ShareContactsErrorCodes2) => {
473
- ShareContactsErrorCodes2["UserRejected"] = "user_rejected";
474
- ShareContactsErrorCodes2["GenericError"] = "generic_error";
475
- return ShareContactsErrorCodes2;
476
- })(ShareContactsErrorCodes || {});
477
- var ShareContactsErrorMessage = {
478
- ["user_rejected" /* UserRejected */]: "User rejected the request.",
479
- ["generic_error" /* GenericError */]: "Something unexpected went wrong."
480
- };
481
- var RequestPermissionErrorCodes = /* @__PURE__ */ ((RequestPermissionErrorCodes2) => {
482
- RequestPermissionErrorCodes2["UserRejected"] = "user_rejected";
483
- RequestPermissionErrorCodes2["GenericError"] = "generic_error";
484
- RequestPermissionErrorCodes2["AlreadyRequested"] = "already_requested";
485
- RequestPermissionErrorCodes2["PermissionDisabled"] = "permission_disabled";
486
- RequestPermissionErrorCodes2["AlreadyGranted"] = "already_granted";
487
- RequestPermissionErrorCodes2["UnsupportedPermission"] = "unsupported_permission";
488
- return RequestPermissionErrorCodes2;
489
- })(RequestPermissionErrorCodes || {});
490
- var RequestPermissionErrorMessage = {
491
- ["user_rejected" /* UserRejected */]: "User declined sharing contacts",
492
- ["generic_error" /* GenericError */]: "Request failed for unknown reason.",
493
- ["already_requested" /* AlreadyRequested */]: "User has already declined turning on notifications once",
494
- ["permission_disabled" /* PermissionDisabled */]: "User does not have this permission enabled in World App",
495
- ["already_granted" /* AlreadyGranted */]: "If the user has already granted this mini app permission",
496
- ["unsupported_permission" /* UnsupportedPermission */]: "The permission requested is not supported by this mini app"
497
- };
498
- var GetPermissionsErrorCodes = /* @__PURE__ */ ((GetPermissionsErrorCodes2) => {
499
- GetPermissionsErrorCodes2["GenericError"] = "generic_error";
500
- return GetPermissionsErrorCodes2;
501
- })(GetPermissionsErrorCodes || {});
502
- var GetPermissionsErrorMessage = {
503
- ["generic_error" /* GenericError */]: "Something unexpected went wrong. Please try again."
504
- };
505
- var SendHapticFeedbackErrorCodes = /* @__PURE__ */ ((SendHapticFeedbackErrorCodes2) => {
506
- SendHapticFeedbackErrorCodes2["GenericError"] = "generic_error";
507
- SendHapticFeedbackErrorCodes2["UserRejected"] = "user_rejected";
508
- return SendHapticFeedbackErrorCodes2;
509
- })(SendHapticFeedbackErrorCodes || {});
510
- var SendHapticFeedbackErrorMessage = {
511
- ["generic_error" /* GenericError */]: "Something unexpected went wrong.",
512
- ["user_rejected" /* UserRejected */]: "User rejected the request."
513
- };
514
-
515
- // helpers/send-webview-event.ts
516
- var sendWebviewEvent = (payload) => {
517
- if (window.webkit) {
518
- window.webkit?.messageHandlers?.minikit?.postMessage?.(payload);
519
- } else if (window.Android) {
520
- window.Android.postMessage?.(JSON.stringify(payload));
521
- }
522
- };
523
-
524
- // types/responses.ts
525
- var ResponseEvent = /* @__PURE__ */ ((ResponseEvent2) => {
526
- ResponseEvent2["MiniAppVerifyAction"] = "miniapp-verify-action";
527
- ResponseEvent2["MiniAppPayment"] = "miniapp-payment";
528
- ResponseEvent2["MiniAppWalletAuth"] = "miniapp-wallet-auth";
529
- ResponseEvent2["MiniAppSendTransaction"] = "miniapp-send-transaction";
530
- ResponseEvent2["MiniAppSignMessage"] = "miniapp-sign-message";
531
- ResponseEvent2["MiniAppSignTypedData"] = "miniapp-sign-typed-data";
532
- ResponseEvent2["MiniAppShareContacts"] = "miniapp-share-contacts";
533
- ResponseEvent2["MiniAppRequestPermission"] = "miniapp-request-permission";
534
- ResponseEvent2["MiniAppGetPermissions"] = "miniapp-get-permissions";
535
- ResponseEvent2["MiniAppSendHapticFeedback"] = "miniapp-send-haptic-feedback";
536
- return ResponseEvent2;
537
- })(ResponseEvent || {});
538
-
539
- // minikit.ts
540
- var sendMiniKitEvent = (payload) => {
541
- sendWebviewEvent(payload);
542
- };
543
- var _MiniKit = class _MiniKit {
544
- static sendInit() {
545
- sendWebviewEvent({
546
- command: "init",
547
- payload: { version: this.MINIKIT_VERSION }
548
- });
549
- }
550
- static subscribe(event, handler) {
551
- if (event === "miniapp-wallet-auth" /* MiniAppWalletAuth */) {
552
- const originalHandler = handler;
553
- const wrappedHandler = (payload) => {
554
- if (payload.status === "success") {
555
- _MiniKit.walletAddress = payload.address;
556
- _MiniKit.getUserByAddress(payload.address).then((user) => {
557
- _MiniKit.user = user;
558
- });
559
- }
560
- originalHandler(payload);
561
- };
562
- this.listeners[event] = wrappedHandler;
563
- } else {
564
- this.listeners[event] = handler;
565
- }
566
- }
567
- static unsubscribe(event) {
568
- delete this.listeners[event];
569
- }
570
- static trigger(event, payload) {
571
- if (!this.listeners[event]) {
572
- console.error(`No handler for event ${event}`);
573
- return;
574
- }
575
- this.listeners[event](payload);
576
- }
577
- static async awaitCommand(event, command, executor) {
578
- return new Promise((resolve) => {
579
- let commandPayload = null;
580
- const handleAndUnsubscribe = (payload) => {
581
- this.unsubscribe(event);
582
- resolve({ commandPayload, finalPayload: payload });
583
- };
584
- this.subscribe(event, handleAndUnsubscribe);
585
- commandPayload = executor();
586
- });
587
- }
588
- static commandsValid(input) {
589
- return Object.entries(this.commandVersion).every(
590
- ([commandName, version]) => {
591
- const commandInput = input.find(
592
- (command) => command.name === commandName
593
- );
594
- if (!commandInput) {
595
- console.error(
596
- `Command ${commandName} is not supported by the app. Try updating the app version`
597
- );
598
- } else {
599
- _MiniKit.isCommandAvailable[commandName] = true;
600
- }
601
- return commandInput ? commandInput.supported_versions.includes(version) : false;
602
- }
603
- );
604
- }
605
- static install(appId) {
606
- if (typeof window === "undefined" || Boolean(window.MiniKit)) {
607
- return {
608
- success: false,
609
- errorCode: "already_installed" /* AlreadyInstalled */,
610
- errorMessage: MiniKitInstallErrorMessage["already_installed" /* AlreadyInstalled */]
611
- };
612
- }
613
- if (!appId) {
614
- console.warn("App ID not provided during install");
615
- } else {
616
- _MiniKit.appId = appId;
617
- }
618
- if (!window.WorldApp) {
619
- return {
620
- success: false,
621
- errorCode: "outside_of_worldapp" /* OutsideOfWorldApp */,
622
- errorMessage: MiniKitInstallErrorMessage["outside_of_worldapp" /* OutsideOfWorldApp */]
623
- };
624
- }
625
- try {
626
- window.MiniKit = _MiniKit;
627
- this.sendInit();
628
- } catch (error) {
629
- console.error(
630
- MiniKitInstallErrorMessage["unknown" /* Unknown */],
631
- error
632
- );
633
- return {
634
- success: false,
635
- errorCode: "unknown" /* Unknown */,
636
- errorMessage: MiniKitInstallErrorMessage["unknown" /* Unknown */]
637
- };
638
- }
639
- if (!this.commandsValid(window.WorldApp.supported_commands)) {
640
- return {
641
- success: false,
642
- errorCode: "app_out_of_date" /* AppOutOfDate */,
643
- errorMessage: MiniKitInstallErrorMessage["app_out_of_date" /* AppOutOfDate */]
644
- };
645
- }
646
- return { success: true };
647
- }
648
- static isInstalled(debug) {
649
- if (debug) console.log("MiniKit is alive!");
650
- const isInstalled = Boolean(window.MiniKit);
651
- if (!isInstalled)
652
- console.error(
653
- "MiniKit is not installed. Make sure you're running the application inside of World App"
654
- );
655
- return isInstalled;
656
- }
657
- };
658
- _MiniKit.MINIKIT_VERSION = 1;
659
- _MiniKit.commandVersion = {
660
- ["verify" /* Verify */]: 1,
661
- ["pay" /* Pay */]: 1,
662
- ["wallet-auth" /* WalletAuth */]: 1,
663
- ["send-transaction" /* SendTransaction */]: 1,
664
- ["sign-message" /* SignMessage */]: 1,
665
- ["sign-typed-data" /* SignTypedData */]: 1,
666
- ["share-contacts" /* ShareContacts */]: 1,
667
- ["request-permission" /* RequestPermission */]: 1,
668
- ["get-permissions" /* GetPermissions */]: 1,
669
- ["send-haptic-feedback" /* SendHapticFeedback */]: 1
670
- };
671
- _MiniKit.isCommandAvailable = {
672
- ["verify" /* Verify */]: false,
673
- ["pay" /* Pay */]: false,
674
- ["wallet-auth" /* WalletAuth */]: false,
675
- ["send-transaction" /* SendTransaction */]: false,
676
- ["sign-message" /* SignMessage */]: false,
677
- ["sign-typed-data" /* SignTypedData */]: false,
678
- ["share-contacts" /* ShareContacts */]: false,
679
- ["request-permission" /* RequestPermission */]: false,
680
- ["get-permissions" /* GetPermissions */]: false,
681
- ["send-haptic-feedback" /* SendHapticFeedback */]: false
682
- };
683
- _MiniKit.listeners = {
684
- ["miniapp-verify-action" /* MiniAppVerifyAction */]: () => {
685
- },
686
- ["miniapp-payment" /* MiniAppPayment */]: () => {
687
- },
688
- ["miniapp-wallet-auth" /* MiniAppWalletAuth */]: () => {
689
- },
690
- ["miniapp-send-transaction" /* MiniAppSendTransaction */]: () => {
691
- },
692
- ["miniapp-sign-message" /* MiniAppSignMessage */]: () => {
693
- },
694
- ["miniapp-sign-typed-data" /* MiniAppSignTypedData */]: () => {
695
- },
696
- ["miniapp-share-contacts" /* MiniAppShareContacts */]: () => {
697
- },
698
- ["miniapp-request-permission" /* MiniAppRequestPermission */]: () => {
699
- },
700
- ["miniapp-get-permissions" /* MiniAppGetPermissions */]: () => {
701
- },
702
- ["miniapp-send-haptic-feedback" /* MiniAppSendHapticFeedback */]: () => {
703
- }
704
- };
705
- _MiniKit.appId = null;
706
- /**
707
- * @deprecated you should use MiniKit.user.walletAddress instead
708
- */
709
- _MiniKit.walletAddress = null;
710
- _MiniKit.user = null;
711
- _MiniKit.getUserByAddress = async (address) => {
712
- const userProfile = await getUserProfile(address);
713
- return {
714
- walletAddress: address,
715
- username: userProfile.username,
716
- profilePictureUrl: userProfile.profilePictureUrl
717
- };
718
- };
719
- _MiniKit.commands = {
720
- verify: (payload) => {
721
- if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["verify" /* Verify */]) {
722
- console.error(
723
- "'verify' command is unavailable. Check MiniKit.install() or update the app version"
724
- );
725
- return null;
726
- }
727
- const timestamp = (/* @__PURE__ */ new Date()).toISOString();
728
- const eventPayload = {
729
- action: encodeAction(payload.action),
730
- signal: generateSignal(payload.signal).digest,
731
- verification_level: payload.verification_level || VerificationLevel.Orb,
732
- timestamp
733
- };
734
- sendMiniKitEvent({
735
- command: "verify" /* Verify */,
736
- version: _MiniKit.commandVersion["verify" /* Verify */],
737
- payload: eventPayload
738
- });
739
- return eventPayload;
740
- },
741
- pay: (payload) => {
742
- if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["pay" /* Pay */]) {
743
- console.error(
744
- "'pay' command is unavailable. Check MiniKit.install() or update the app version"
745
- );
746
- return null;
747
- }
748
- if (!validatePaymentPayload(payload)) {
749
- return null;
750
- }
751
- const network = "worldchain" /* WorldChain */;
752
- const eventPayload = {
753
- ...payload,
754
- network
755
- };
756
- sendMiniKitEvent({
757
- command: "pay" /* Pay */,
758
- version: _MiniKit.commandVersion["pay" /* Pay */],
759
- payload: eventPayload
760
- });
761
- return eventPayload;
762
- },
763
- walletAuth: (payload) => {
764
- if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["wallet-auth" /* WalletAuth */]) {
765
- console.error(
766
- "'walletAuth' command is unavailable. Check MiniKit.install() or update the app version"
767
- );
768
- return null;
769
- }
770
- const validationResult = validateWalletAuthCommandInput(payload);
771
- if (!validationResult.valid) {
772
- console.error(
773
- "Failed to validate wallet auth input:\n\n -->",
774
- validationResult.message
775
- );
776
- return null;
777
- }
778
- let protocol = null;
779
- try {
780
- const currentUrl = new URL(window.location.href);
781
- protocol = currentUrl.protocol.split(":")[0];
782
- } catch (error) {
783
- console.error("Failed to get current URL", error);
784
- return null;
785
- }
786
- const siweMessage = generateSiweMessage({
787
- scheme: protocol,
788
- domain: window.location.host,
789
- statement: payload.statement ?? void 0,
790
- uri: window.location.href,
791
- version: 1,
792
- chain_id: 480,
793
- nonce: payload.nonce,
794
- issued_at: (/* @__PURE__ */ new Date()).toISOString(),
795
- expiration_time: payload.expirationTime?.toISOString() ?? void 0,
796
- not_before: payload.notBefore?.toISOString() ?? void 0,
797
- request_id: payload.requestId ?? void 0
798
- });
799
- const walletAuthPayload = { siweMessage };
800
- sendMiniKitEvent({
801
- command: "wallet-auth" /* WalletAuth */,
802
- version: _MiniKit.commandVersion["wallet-auth" /* WalletAuth */],
803
- payload: walletAuthPayload
804
- });
805
- return walletAuthPayload;
806
- },
807
- sendTransaction: (payload) => {
808
- if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["send-transaction" /* SendTransaction */]) {
809
- console.error(
810
- "'sendTransaction' command is unavailable. Check MiniKit.install() or update the app version"
811
- );
812
- return null;
813
- }
814
- const validatedPayload = validateSendTransactionPayload(payload);
815
- sendMiniKitEvent({
816
- command: "send-transaction" /* SendTransaction */,
817
- version: 1,
818
- payload: validatedPayload
819
- });
820
- return validatedPayload;
821
- },
822
- signMessage: (payload) => {
823
- if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["sign-message" /* SignMessage */]) {
824
- console.error(
825
- "'signMessage' command is unavailable. Check MiniKit.install() or update the app version"
826
- );
827
- return null;
828
- }
829
- sendMiniKitEvent({
830
- command: "sign-message" /* SignMessage */,
831
- version: 1,
832
- payload
833
- });
834
- return payload;
835
- },
836
- signTypedData: (payload) => {
837
- if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["sign-typed-data" /* SignTypedData */]) {
838
- console.error(
839
- "'signTypedData' command is unavailable. Check MiniKit.install() or update the app version"
840
- );
841
- return null;
842
- }
843
- sendMiniKitEvent({
844
- command: "sign-typed-data" /* SignTypedData */,
845
- version: 1,
846
- payload
847
- });
848
- return payload;
849
- },
850
- shareContacts: (payload) => {
851
- if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["sign-typed-data" /* SignTypedData */]) {
852
- console.error(
853
- "'shareContacts' command is unavailable. Check MiniKit.install() or update the app version"
854
- );
855
- return null;
856
- }
857
- sendMiniKitEvent({
858
- command: "share-contacts" /* ShareContacts */,
859
- version: 1,
860
- payload
861
- });
862
- return payload;
863
- },
864
- requestPermission: (payload) => {
865
- if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["request-permission" /* RequestPermission */]) {
866
- console.error(
867
- "'requestPermission' command is unavailable. Check MiniKit.install() or update the app version"
868
- );
869
- return null;
870
- }
871
- sendMiniKitEvent({
872
- command: "request-permission" /* RequestPermission */,
873
- version: 1,
874
- payload
875
- });
876
- return payload;
877
- },
878
- getPermissions: () => {
879
- if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["get-permissions" /* GetPermissions */]) {
880
- console.error(
881
- "'getPermissions' command is unavailable. Check MiniKit.install() or update the app version"
882
- );
883
- return null;
884
- }
885
- sendMiniKitEvent({
886
- command: "get-permissions" /* GetPermissions */,
887
- version: 1,
888
- payload: {}
889
- });
890
- return {
891
- status: "sent"
892
- };
893
- },
894
- sendHapticFeedback: (payload) => {
895
- if (typeof window === "undefined" || !_MiniKit.isCommandAvailable["send-haptic-feedback" /* SendHapticFeedback */]) {
896
- console.error(
897
- "'sendHapticFeedback' command is unavailable. Check MiniKit.install() or update the app version"
898
- );
899
- return null;
900
- }
901
- sendMiniKitEvent({
902
- command: "send-haptic-feedback" /* SendHapticFeedback */,
903
- version: 1,
904
- payload
905
- });
906
- return payload;
907
- }
908
- };
909
- /**
910
- * This object contains async versions of all the commands.
911
- * Instead of using event listeners, you can just `await` these.
912
- *
913
- * They return a standardized object
914
- *
915
- * commandPayload - object returned by the command function
916
- *
917
- * finalPayload - object returned by the event listener, or in other words, WorldApp response
918
- */
919
- _MiniKit.commandsAsync = {
920
- verify: async (payload) => {
921
- return new Promise(async (resolve, reject) => {
922
- try {
923
- const response = await _MiniKit.awaitCommand(
924
- "miniapp-verify-action" /* MiniAppVerifyAction */,
925
- "verify" /* Verify */,
926
- () => _MiniKit.commands.verify(payload)
927
- );
928
- resolve(response);
929
- } catch (error) {
930
- reject(error);
931
- }
932
- });
933
- },
934
- pay: async (payload) => {
935
- return new Promise(async (resolve, reject) => {
936
- try {
937
- const response = await _MiniKit.awaitCommand(
938
- "miniapp-payment" /* MiniAppPayment */,
939
- "pay" /* Pay */,
940
- () => _MiniKit.commands.pay(payload)
941
- );
942
- resolve(response);
943
- } catch (error) {
944
- reject(error);
945
- }
946
- });
947
- },
948
- walletAuth: async (payload) => {
949
- return new Promise(async (resolve, reject) => {
950
- try {
951
- const response = await _MiniKit.awaitCommand(
952
- "miniapp-wallet-auth" /* MiniAppWalletAuth */,
953
- "wallet-auth" /* WalletAuth */,
954
- () => _MiniKit.commands.walletAuth(payload)
955
- );
956
- return resolve(response);
957
- } catch (error) {
958
- reject(error);
959
- }
960
- });
961
- },
962
- sendTransaction: async (payload) => {
963
- return new Promise(async (resolve, reject) => {
964
- try {
965
- const response = await _MiniKit.awaitCommand(
966
- "miniapp-send-transaction" /* MiniAppSendTransaction */,
967
- "send-transaction" /* SendTransaction */,
968
- () => _MiniKit.commands.sendTransaction(payload)
969
- );
970
- return resolve(response);
971
- } catch (error) {
972
- reject(error);
973
- }
974
- });
975
- },
976
- signMessage: async (payload) => {
977
- return new Promise(async (resolve, reject) => {
978
- try {
979
- const response = await _MiniKit.awaitCommand(
980
- "miniapp-sign-message" /* MiniAppSignMessage */,
981
- "sign-message" /* SignMessage */,
982
- () => _MiniKit.commands.signMessage(payload)
983
- );
984
- return resolve(response);
985
- } catch (error) {
986
- reject(error);
987
- }
988
- });
989
- },
990
- signTypedData: async (payload) => {
991
- return new Promise(async (resolve, reject) => {
992
- try {
993
- const response = await _MiniKit.awaitCommand(
994
- "miniapp-sign-typed-data" /* MiniAppSignTypedData */,
995
- "sign-typed-data" /* SignTypedData */,
996
- () => _MiniKit.commands.signTypedData(payload)
997
- );
998
- return resolve(response);
999
- } catch (error) {
1000
- reject(error);
1001
- }
1002
- });
1003
- },
1004
- shareContacts: async (payload) => {
1005
- return new Promise(async (resolve, reject) => {
1006
- try {
1007
- const response = await _MiniKit.awaitCommand(
1008
- "miniapp-share-contacts" /* MiniAppShareContacts */,
1009
- "share-contacts" /* ShareContacts */,
1010
- () => _MiniKit.commands.shareContacts(payload)
1011
- );
1012
- return resolve(response);
1013
- } catch (error) {
1014
- reject(error);
1015
- }
1016
- });
1017
- },
1018
- requestPermission: async (payload) => {
1019
- return new Promise(async (resolve, reject) => {
1020
- try {
1021
- const response = await _MiniKit.awaitCommand(
1022
- "miniapp-request-permission" /* MiniAppRequestPermission */,
1023
- "request-permission" /* RequestPermission */,
1024
- () => _MiniKit.commands.requestPermission(payload)
1025
- );
1026
- resolve(response);
1027
- } catch (error) {
1028
- reject(error);
1029
- }
1030
- });
1031
- },
1032
- getPermissions: async () => {
1033
- return new Promise(async (resolve, reject) => {
1034
- try {
1035
- const response = await _MiniKit.awaitCommand(
1036
- "miniapp-get-permissions" /* MiniAppGetPermissions */,
1037
- "get-permissions" /* GetPermissions */,
1038
- () => _MiniKit.commands.getPermissions()
1039
- );
1040
- resolve(response);
1041
- } catch (error) {
1042
- reject(error);
1043
- }
1044
- });
1045
- },
1046
- sendHapticFeedback: async (payload) => {
1047
- return new Promise(async (resolve, reject) => {
1048
- try {
1049
- const response = await _MiniKit.awaitCommand(
1050
- "miniapp-send-haptic-feedback" /* MiniAppSendHapticFeedback */,
1051
- "send-haptic-feedback" /* SendHapticFeedback */,
1052
- () => _MiniKit.commands.sendHapticFeedback(payload)
1053
- );
1054
- resolve(response);
1055
- } catch (error) {
1056
- reject(error);
1057
- }
1058
- });
1059
- }
1060
- };
1061
- var MiniKit = _MiniKit;
2
+ AppErrorCodes,
3
+ Command,
4
+ GetPermissionsErrorCodes,
5
+ GetPermissionsErrorMessage,
6
+ MiniKit,
7
+ MiniKitInstallErrorCodes,
8
+ MiniKitInstallErrorMessage,
9
+ Network,
10
+ PaymentErrorCodes,
11
+ PaymentErrorMessage,
12
+ PaymentValidationErrors,
13
+ Permission,
14
+ RequestPermissionErrorCodes,
15
+ RequestPermissionErrorMessage,
16
+ ResponseEvent,
17
+ SendHapticFeedbackErrorCodes,
18
+ SendHapticFeedbackErrorMessage,
19
+ SendTransactionErrorCodes,
20
+ SendTransactionErrorMessage,
21
+ ShareContactsErrorCodes,
22
+ ShareContactsErrorMessage,
23
+ ShareFilesErrorCodes,
24
+ ShareFilesErrorMessage,
25
+ SignMessageErrorCodes,
26
+ SignMessageErrorMessage,
27
+ SignTypedDataErrorCodes,
28
+ SignTypedDataErrorMessage,
29
+ TokenDecimals,
30
+ Tokens,
31
+ VerificationErrorMessage,
32
+ WalletAuthErrorCodes,
33
+ WalletAuthErrorMessage,
34
+ parseSiweMessage,
35
+ tokenToDecimals,
36
+ verifySiweMessage
37
+ } from "./chunk-7FYGA6HX.js";
1062
38
 
1063
39
  // index.ts
1064
- import { VerificationLevel as VerificationLevel2 } from "@worldcoin/idkit-core";
40
+ import { VerificationLevel } from "@worldcoin/idkit-core";
1065
41
  import {
1066
42
  verifyCloudProof
1067
43
  } from "@worldcoin/idkit-core/backend";
1068
44
 
1069
45
  // helpers/address-book/index.ts
1070
- import { createPublicClient as createPublicClient2, http as http2 } from "viem";
1071
- import { worldchain as worldchain2 } from "viem/chains";
46
+ import { createPublicClient, http } from "viem";
47
+ import { worldchain } from "viem/chains";
1072
48
  var worldIdAddressBookContractAddress = "0x57b930D551e677CC36e2fA036Ae2fe8FdaE0330D";
1073
49
  var addressVerifiedUntilAbi = [
1074
50
  {
@@ -1092,9 +68,9 @@ var addressVerifiedUntilAbi = [
1092
68
  }
1093
69
  ];
1094
70
  var getIsUserVerified = async (walletAddress, rpcUrl) => {
1095
- const publicClient = createPublicClient2({
1096
- chain: worldchain2,
1097
- transport: http2(
71
+ const publicClient = createPublicClient({
72
+ chain: worldchain,
73
+ transport: http(
1098
74
  rpcUrl || "https://worldchain-mainnet.g.alchemy.com/public"
1099
75
  )
1100
76
  });
@@ -1132,22 +108,23 @@ export {
1132
108
  RequestPermissionErrorCodes,
1133
109
  RequestPermissionErrorMessage,
1134
110
  ResponseEvent,
1135
- SAFE_CONTRACT_ABI,
1136
111
  SendHapticFeedbackErrorCodes,
1137
112
  SendHapticFeedbackErrorMessage,
1138
113
  SendTransactionErrorCodes,
1139
114
  SendTransactionErrorMessage,
1140
115
  ShareContactsErrorCodes,
1141
116
  ShareContactsErrorMessage,
117
+ ShareFilesErrorCodes,
118
+ ShareFilesErrorMessage,
1142
119
  SignMessageErrorCodes,
1143
120
  SignMessageErrorMessage,
1144
121
  SignTypedDataErrorCodes,
1145
122
  SignTypedDataErrorMessage,
1146
123
  TokenDecimals,
1147
124
  Tokens,
1148
- AppErrorCodes2 as VerificationErrorCodes,
125
+ AppErrorCodes as VerificationErrorCodes,
1149
126
  VerificationErrorMessage,
1150
- VerificationLevel2 as VerificationLevel,
127
+ VerificationLevel,
1151
128
  WalletAuthErrorCodes,
1152
129
  WalletAuthErrorMessage,
1153
130
  getIsUserVerified,