@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.
- package/README.md +107 -0
- package/build/address-book.cjs +81 -0
- package/build/address-book.d.cts +3 -0
- package/build/address-book.d.ts +3 -0
- package/build/address-book.js +54 -0
- package/build/chunk-2UPJKPQ6.js +272 -0
- package/build/chunk-EHBM7OXH.js +596 -0
- package/build/chunk-LHHKY77D.js +274 -0
- package/build/chunk-TGXD24YD.js +279 -0
- package/build/chunk-Z2UGRZJ2.js +1635 -0
- package/build/command-exports.cjs +1762 -0
- package/build/command-exports.d.cts +105 -0
- package/build/command-exports.d.ts +105 -0
- package/build/command-exports.js +129 -0
- package/build/connector/index.cjs +2601 -0
- package/build/connector/index.d.cts +55 -0
- package/build/connector/index.d.ts +55 -0
- package/build/connector/index.js +90 -0
- package/build/index.cjs +1634 -1627
- package/build/index.d.cts +143 -671
- package/build/index.d.ts +143 -671
- package/build/index.js +7 -206
- package/build/minikit-provider.cjs +1650 -948
- package/build/minikit-provider.d.cts +2 -1
- package/build/minikit-provider.d.ts +2 -1
- package/build/minikit-provider.js +13 -2
- package/build/provider-DeDUsLbs.d.cts +43 -0
- package/build/provider-DeDUsLbs.d.ts +43 -0
- package/build/siwe-exports.cjs +249 -0
- package/build/siwe-exports.d.cts +10 -0
- package/build/siwe-exports.d.ts +10 -0
- package/build/siwe-exports.js +8 -0
- package/build/types-CC2x79HX.d.ts +525 -0
- package/build/types-CSyzFDPt.d.cts +223 -0
- package/build/types-CSyzFDPt.d.ts +223 -0
- package/build/types-_jfLbcJW.d.cts +525 -0
- package/package.json +73 -11
- package/build/chunk-62NZ34E4.js +0 -2092
- package/index.ts +0 -29
package/build/index.js
CHANGED
|
@@ -1,211 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
AttestationErrorMessage,
|
|
5
|
-
COMMAND_VERSIONS,
|
|
6
|
-
ChatErrorCodes,
|
|
7
|
-
ChatErrorMessage,
|
|
8
|
-
Command,
|
|
9
|
-
GetPermissionsErrorCodes,
|
|
10
|
-
GetPermissionsErrorMessage,
|
|
11
|
-
MiniAppLaunchLocation,
|
|
12
|
-
MiniKit,
|
|
13
|
-
MiniKitInstallErrorCodes,
|
|
14
|
-
MiniKitInstallErrorMessage,
|
|
15
|
-
Network,
|
|
16
|
-
PaymentErrorCodes,
|
|
17
|
-
PaymentErrorMessage,
|
|
18
|
-
Permission,
|
|
19
|
-
RequestPermissionErrorCodes,
|
|
20
|
-
RequestPermissionErrorMessage,
|
|
21
|
-
ResponseEvent,
|
|
22
|
-
SendHapticFeedbackErrorCodes,
|
|
23
|
-
SendHapticFeedbackErrorMessage,
|
|
24
|
-
SendTransactionErrorCodes,
|
|
25
|
-
SendTransactionErrorMessage,
|
|
26
|
-
ShareContactsErrorCodes,
|
|
27
|
-
ShareContactsErrorMessage,
|
|
28
|
-
ShareFilesErrorCodes,
|
|
29
|
-
ShareFilesErrorMessage,
|
|
30
|
-
SignMessageErrorCodes,
|
|
31
|
-
SignMessageErrorMessage,
|
|
32
|
-
SignTypedDataErrorCodes,
|
|
33
|
-
SignTypedDataErrorMessage,
|
|
34
|
-
TokenDecimals,
|
|
35
|
-
Tokens,
|
|
36
|
-
WalletAuthErrorCodes,
|
|
37
|
-
WalletAuthErrorMessage,
|
|
38
|
-
createAsyncCommands,
|
|
39
|
-
createAttestationAsyncCommand,
|
|
40
|
-
createAttestationCommand,
|
|
41
|
-
createChatAsyncCommand,
|
|
42
|
-
createChatCommand,
|
|
43
|
-
createCloseMiniAppCommand,
|
|
44
|
-
createCommands,
|
|
45
|
-
createGetPermissionsAsyncCommand,
|
|
46
|
-
createGetPermissionsCommand,
|
|
47
|
-
createPayAsyncCommand,
|
|
48
|
-
createPayCommand,
|
|
49
|
-
createRequestPermissionAsyncCommand,
|
|
50
|
-
createRequestPermissionCommand,
|
|
51
|
-
createSendHapticFeedbackAsyncCommand,
|
|
52
|
-
createSendHapticFeedbackCommand,
|
|
53
|
-
createSendTransactionAsyncCommand,
|
|
54
|
-
createSendTransactionCommand,
|
|
55
|
-
createShareAsyncCommand,
|
|
56
|
-
createShareCommand,
|
|
57
|
-
createShareContactsAsyncCommand,
|
|
58
|
-
createShareContactsCommand,
|
|
59
|
-
createSignMessageAsyncCommand,
|
|
60
|
-
createSignMessageCommand,
|
|
61
|
-
createSignTypedDataAsyncCommand,
|
|
62
|
-
createSignTypedDataCommand,
|
|
63
|
-
createVerifyAsyncCommand,
|
|
64
|
-
createVerifyCommand,
|
|
65
|
-
createWalletAuthAsyncCommand,
|
|
66
|
-
createWalletAuthCommand,
|
|
67
|
-
isCommandAvailable,
|
|
68
|
-
mapWorldAppLaunchLocation,
|
|
69
|
-
parseSiweMessage,
|
|
70
|
-
sendMiniKitEvent,
|
|
71
|
-
setCommandAvailable,
|
|
72
|
-
tokenToDecimals,
|
|
73
|
-
validateCommands,
|
|
74
|
-
verifySiweMessage
|
|
75
|
-
} from "./chunk-62NZ34E4.js";
|
|
76
|
-
|
|
77
|
-
// index.ts
|
|
78
|
-
import { VerificationLevel } from "@worldcoin/idkit-core";
|
|
2
|
+
getWorldAppProvider
|
|
3
|
+
} from "./chunk-TGXD24YD.js";
|
|
79
4
|
import {
|
|
80
|
-
|
|
81
|
-
} from "
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
import { createPublicClient, http } from "viem";
|
|
85
|
-
import { worldchain } from "viem/chains";
|
|
86
|
-
var worldIdAddressBookContractAddress = "0x57b930D551e677CC36e2fA036Ae2fe8FdaE0330D";
|
|
87
|
-
var addressVerifiedUntilAbi = [
|
|
88
|
-
{
|
|
89
|
-
inputs: [
|
|
90
|
-
{
|
|
91
|
-
internalType: "address",
|
|
92
|
-
name: "",
|
|
93
|
-
type: "address"
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
name: "addressVerifiedUntil",
|
|
97
|
-
outputs: [
|
|
98
|
-
{
|
|
99
|
-
internalType: "uint256",
|
|
100
|
-
name: "",
|
|
101
|
-
type: "uint256"
|
|
102
|
-
}
|
|
103
|
-
],
|
|
104
|
-
stateMutability: "view",
|
|
105
|
-
type: "function"
|
|
106
|
-
}
|
|
107
|
-
];
|
|
108
|
-
var getIsUserVerified = async (walletAddress, rpcUrl) => {
|
|
109
|
-
const publicClient = createPublicClient({
|
|
110
|
-
chain: worldchain,
|
|
111
|
-
transport: http(
|
|
112
|
-
rpcUrl || "https://worldchain-mainnet.g.alchemy.com/public"
|
|
113
|
-
)
|
|
114
|
-
});
|
|
115
|
-
try {
|
|
116
|
-
const verifiedUntilResponse = await publicClient.readContract({
|
|
117
|
-
address: worldIdAddressBookContractAddress,
|
|
118
|
-
abi: addressVerifiedUntilAbi,
|
|
119
|
-
functionName: "addressVerifiedUntil",
|
|
120
|
-
args: [walletAddress]
|
|
121
|
-
});
|
|
122
|
-
const verifiedUntil = Number(verifiedUntilResponse.toString());
|
|
123
|
-
if (!Number.isFinite(verifiedUntil)) {
|
|
124
|
-
console.warn("Invalid verifiedUntil value:", verifiedUntil);
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
const currentTime = Math.floor(Date.now() / 1e3);
|
|
128
|
-
return verifiedUntil > currentTime;
|
|
129
|
-
} catch (error) {
|
|
130
|
-
console.error("Error verifying user:", error);
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
5
|
+
MiniKit
|
|
6
|
+
} from "./chunk-EHBM7OXH.js";
|
|
7
|
+
import "./chunk-Z2UGRZJ2.js";
|
|
8
|
+
import "./chunk-LHHKY77D.js";
|
|
134
9
|
export {
|
|
135
|
-
AttestationErrorCodes,
|
|
136
|
-
AttestationErrorMessage,
|
|
137
|
-
COMMAND_VERSIONS,
|
|
138
|
-
ChatErrorCodes,
|
|
139
|
-
ChatErrorMessage,
|
|
140
|
-
Command,
|
|
141
|
-
GetPermissionsErrorCodes,
|
|
142
|
-
GetPermissionsErrorMessage,
|
|
143
|
-
MiniAppLaunchLocation,
|
|
144
10
|
MiniKit,
|
|
145
|
-
|
|
146
|
-
MiniKitInstallErrorMessage,
|
|
147
|
-
Network,
|
|
148
|
-
PaymentErrorCodes,
|
|
149
|
-
PaymentErrorMessage,
|
|
150
|
-
Permission,
|
|
151
|
-
RequestPermissionErrorCodes,
|
|
152
|
-
RequestPermissionErrorMessage,
|
|
153
|
-
ResponseEvent,
|
|
154
|
-
SendHapticFeedbackErrorCodes,
|
|
155
|
-
SendHapticFeedbackErrorMessage,
|
|
156
|
-
SendTransactionErrorCodes,
|
|
157
|
-
SendTransactionErrorMessage,
|
|
158
|
-
ShareContactsErrorCodes,
|
|
159
|
-
ShareContactsErrorMessage,
|
|
160
|
-
ShareFilesErrorCodes,
|
|
161
|
-
ShareFilesErrorMessage,
|
|
162
|
-
SignMessageErrorCodes,
|
|
163
|
-
SignMessageErrorMessage,
|
|
164
|
-
SignTypedDataErrorCodes,
|
|
165
|
-
SignTypedDataErrorMessage,
|
|
166
|
-
TokenDecimals,
|
|
167
|
-
Tokens,
|
|
168
|
-
AppErrorCodes as VerificationErrorCodes,
|
|
169
|
-
VerificationLevel,
|
|
170
|
-
WalletAuthErrorCodes,
|
|
171
|
-
WalletAuthErrorMessage,
|
|
172
|
-
createAsyncCommands,
|
|
173
|
-
createAttestationAsyncCommand,
|
|
174
|
-
createAttestationCommand,
|
|
175
|
-
createChatAsyncCommand,
|
|
176
|
-
createChatCommand,
|
|
177
|
-
createCloseMiniAppCommand,
|
|
178
|
-
createCommands,
|
|
179
|
-
createGetPermissionsAsyncCommand,
|
|
180
|
-
createGetPermissionsCommand,
|
|
181
|
-
createPayAsyncCommand,
|
|
182
|
-
createPayCommand,
|
|
183
|
-
createRequestPermissionAsyncCommand,
|
|
184
|
-
createRequestPermissionCommand,
|
|
185
|
-
createSendHapticFeedbackAsyncCommand,
|
|
186
|
-
createSendHapticFeedbackCommand,
|
|
187
|
-
createSendTransactionAsyncCommand,
|
|
188
|
-
createSendTransactionCommand,
|
|
189
|
-
createShareAsyncCommand,
|
|
190
|
-
createShareCommand,
|
|
191
|
-
createShareContactsAsyncCommand,
|
|
192
|
-
createShareContactsCommand,
|
|
193
|
-
createSignMessageAsyncCommand,
|
|
194
|
-
createSignMessageCommand,
|
|
195
|
-
createSignTypedDataAsyncCommand,
|
|
196
|
-
createSignTypedDataCommand,
|
|
197
|
-
createVerifyAsyncCommand,
|
|
198
|
-
createVerifyCommand,
|
|
199
|
-
createWalletAuthAsyncCommand,
|
|
200
|
-
createWalletAuthCommand,
|
|
201
|
-
getIsUserVerified,
|
|
202
|
-
isCommandAvailable,
|
|
203
|
-
mapWorldAppLaunchLocation,
|
|
204
|
-
parseSiweMessage,
|
|
205
|
-
sendMiniKitEvent,
|
|
206
|
-
setCommandAvailable,
|
|
207
|
-
tokenToDecimals,
|
|
208
|
-
validateCommands,
|
|
209
|
-
verifyCloudProof,
|
|
210
|
-
verifySiweMessage
|
|
11
|
+
getWorldAppProvider
|
|
211
12
|
};
|