@moon-x/core 0.2.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/README.md +39 -0
- package/dist/chain-C9dvKXUY.d.mts +48 -0
- package/dist/chain-C9dvKXUY.d.ts +48 -0
- package/dist/chunk-264CEGDS.mjs +46 -0
- package/dist/chunk-CDT4MC7S.mjs +1532 -0
- package/dist/chunk-CMYR6AOY.mjs +0 -0
- package/dist/chunk-GQKIA37O.mjs +20 -0
- package/dist/chunk-IMLBIIJ4.mjs +36 -0
- package/dist/chunk-MOREUKOG.mjs +18 -0
- package/dist/chunk-SOKLPX7V.mjs +270 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +402 -0
- package/dist/index.mjs +33 -0
- package/dist/interfaces-9k0eKCc4.d.ts +120 -0
- package/dist/interfaces-fNhwnCeY.d.mts +120 -0
- package/dist/lib/index.d.mts +410 -0
- package/dist/lib/index.d.ts +410 -0
- package/dist/lib/index.js +1622 -0
- package/dist/lib/index.mjs +89 -0
- package/dist/passkey-cache-B9PT3AWX.d.mts +47 -0
- package/dist/passkey-cache-B9PT3AWX.d.ts +47 -0
- package/dist/passkey-metadata-QqFF2SWQ.d.mts +25 -0
- package/dist/passkey-metadata-QqFF2SWQ.d.ts +25 -0
- package/dist/post-message-C_99BCBh.d.mts +70 -0
- package/dist/post-message-C_99BCBh.d.ts +70 -0
- package/dist/react/ethereum.d.mts +26 -0
- package/dist/react/ethereum.d.ts +26 -0
- package/dist/react/ethereum.js +99 -0
- package/dist/react/ethereum.mjs +56 -0
- package/dist/react/index.d.mts +182 -0
- package/dist/react/index.d.ts +182 -0
- package/dist/react/index.js +586 -0
- package/dist/react/index.mjs +328 -0
- package/dist/react/solana.d.mts +17 -0
- package/dist/react/solana.d.ts +17 -0
- package/dist/react/solana.js +75 -0
- package/dist/react/solana.mjs +35 -0
- package/dist/sdk/index.d.mts +126 -0
- package/dist/sdk/index.d.ts +126 -0
- package/dist/sdk/index.js +864 -0
- package/dist/sdk/index.mjs +579 -0
- package/dist/types/index.d.mts +1190 -0
- package/dist/types/index.d.ts +1190 -0
- package/dist/types/index.js +64 -0
- package/dist/types/index.mjs +10 -0
- package/dist/utils/index.d.mts +11 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.js +365 -0
- package/dist/utils/index.mjs +25 -0
- package/dist/web/index.d.mts +20 -0
- package/dist/web/index.d.ts +20 -0
- package/dist/web/index.js +470 -0
- package/dist/web/index.mjs +155 -0
- package/package.json +111 -0
|
@@ -0,0 +1,1190 @@
|
|
|
1
|
+
import { a as ChainLikeWithId, C as Chain } from '../chain-C9dvKXUY.js';
|
|
2
|
+
export { B as BlockExplorer, E as EthereumChainConfig, N as NativeCurrency, R as RpcConfig, b as RpcUrls } from '../chain-C9dvKXUY.js';
|
|
3
|
+
|
|
4
|
+
interface PublicWallet {
|
|
5
|
+
id: string;
|
|
6
|
+
app_id: string;
|
|
7
|
+
user_id: string;
|
|
8
|
+
key_id: string;
|
|
9
|
+
key_share: string;
|
|
10
|
+
public_address: string;
|
|
11
|
+
wallet_type: WalletChain;
|
|
12
|
+
algorithm: string;
|
|
13
|
+
derivation_path?: string;
|
|
14
|
+
created_at: string;
|
|
15
|
+
}
|
|
16
|
+
interface PublicEthereumWallet extends PublicWallet {
|
|
17
|
+
chainId?: number;
|
|
18
|
+
switchChain?: (targetChainId: number) => Promise<void>;
|
|
19
|
+
getEthereumProvider?: () => Promise<any>;
|
|
20
|
+
}
|
|
21
|
+
interface BaseUIOptions {
|
|
22
|
+
title?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
buttonText?: string;
|
|
25
|
+
showWalletUI?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface BaseSignMessageParams {
|
|
28
|
+
message: string;
|
|
29
|
+
wallet: PublicWallet;
|
|
30
|
+
options?: {
|
|
31
|
+
uiOptions?: BaseUIOptions;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
interface BaseSignMessageResult {
|
|
35
|
+
signature: Uint8Array;
|
|
36
|
+
signedMessage?: Uint8Array;
|
|
37
|
+
}
|
|
38
|
+
interface BaseSignTransactionParams {
|
|
39
|
+
transaction: Uint8Array | string;
|
|
40
|
+
wallet: PublicWallet;
|
|
41
|
+
options?: {
|
|
42
|
+
uiOptions?: BaseUIOptions;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
interface BaseSignTransactionResult {
|
|
46
|
+
signature: Uint8Array;
|
|
47
|
+
signedTransaction: Uint8Array | string;
|
|
48
|
+
}
|
|
49
|
+
interface BaseSendTransactionParams {
|
|
50
|
+
transaction: Uint8Array | string;
|
|
51
|
+
wallet: PublicWallet;
|
|
52
|
+
rpcUrl: string;
|
|
53
|
+
options?: {
|
|
54
|
+
uiOptions?: BaseUIOptions;
|
|
55
|
+
commitment?: string;
|
|
56
|
+
encoding?: string;
|
|
57
|
+
replaceRecentBlockhash?: boolean;
|
|
58
|
+
sigVerify?: boolean;
|
|
59
|
+
minContextSlot?: number;
|
|
60
|
+
innerInstructions?: boolean;
|
|
61
|
+
accounts?: any[];
|
|
62
|
+
network?: string;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
interface BaseSendTransactionResult {
|
|
66
|
+
signature: Uint8Array;
|
|
67
|
+
transactionHash: string;
|
|
68
|
+
walletAddress: string;
|
|
69
|
+
}
|
|
70
|
+
interface BaseGetBalanceParams {
|
|
71
|
+
wallet: PublicWallet;
|
|
72
|
+
}
|
|
73
|
+
interface BaseGetBalanceResult {
|
|
74
|
+
balanceBaseUnit: string;
|
|
75
|
+
balanceNativeUnit: string;
|
|
76
|
+
network: string;
|
|
77
|
+
walletAddress: string;
|
|
78
|
+
}
|
|
79
|
+
interface BaseGetTokenAccountsParams {
|
|
80
|
+
wallet: PublicWallet;
|
|
81
|
+
}
|
|
82
|
+
interface BaseWalletHooks {
|
|
83
|
+
useWallets: () => {
|
|
84
|
+
wallets: PublicWallet[];
|
|
85
|
+
loading: boolean;
|
|
86
|
+
error?: Error;
|
|
87
|
+
};
|
|
88
|
+
useSignMessage: () => {
|
|
89
|
+
signMessage: (params: BaseSignMessageParams) => Promise<BaseSignMessageResult>;
|
|
90
|
+
loading: boolean;
|
|
91
|
+
error?: Error;
|
|
92
|
+
};
|
|
93
|
+
useSignTransaction: () => {
|
|
94
|
+
signTransaction: (params: BaseSignTransactionParams) => Promise<BaseSignTransactionResult>;
|
|
95
|
+
loading: boolean;
|
|
96
|
+
error?: Error;
|
|
97
|
+
};
|
|
98
|
+
useSendTransaction: () => {
|
|
99
|
+
sendTransaction: (params: BaseSendTransactionParams) => Promise<BaseSendTransactionResult>;
|
|
100
|
+
loading: boolean;
|
|
101
|
+
error?: Error;
|
|
102
|
+
};
|
|
103
|
+
useGetBalance: () => {
|
|
104
|
+
getBalance: (params: BaseGetBalanceParams) => Promise<BaseGetBalanceResult>;
|
|
105
|
+
loading: boolean;
|
|
106
|
+
error?: Error;
|
|
107
|
+
};
|
|
108
|
+
useGetTokenAccounts: () => {
|
|
109
|
+
getTokenAccounts: (params: BaseGetTokenAccountsParams) => Promise<any>;
|
|
110
|
+
loading: boolean;
|
|
111
|
+
error?: Error;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
type TransactionUIOptions = {
|
|
115
|
+
title?: string;
|
|
116
|
+
action?: string;
|
|
117
|
+
contractInfo?: ContractUIOptions;
|
|
118
|
+
};
|
|
119
|
+
type ContractUIOptions = {
|
|
120
|
+
url?: string;
|
|
121
|
+
name?: string;
|
|
122
|
+
imgUrl?: string;
|
|
123
|
+
imgAltText?: string;
|
|
124
|
+
imgSize?: "sm" | "lg";
|
|
125
|
+
};
|
|
126
|
+
type WalletType = "solana" | "ethereum";
|
|
127
|
+
type TransactionCommitment = "processed" | "confirmed" | "finalized";
|
|
128
|
+
type TransactionEncoding = "base64" | "base58" | "json" | "jsonParsed";
|
|
129
|
+
interface WalletError extends Error {
|
|
130
|
+
code: string;
|
|
131
|
+
details?: any;
|
|
132
|
+
}
|
|
133
|
+
declare const WALLET_ERROR_CODES: {
|
|
134
|
+
readonly WALLET_NOT_CONNECTED: "WALLET_NOT_CONNECTED";
|
|
135
|
+
readonly USER_REJECTED: "USER_REJECTED";
|
|
136
|
+
readonly INVALID_MESSAGE: "INVALID_MESSAGE";
|
|
137
|
+
readonly INVALID_TRANSACTION: "INVALID_TRANSACTION";
|
|
138
|
+
readonly NETWORK_ERROR: "NETWORK_ERROR";
|
|
139
|
+
readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
|
|
140
|
+
};
|
|
141
|
+
type WalletErrorCode = (typeof WALLET_ERROR_CODES)[keyof typeof WALLET_ERROR_CODES];
|
|
142
|
+
type SharesDeviceRequest = {
|
|
143
|
+
publishableKey: string;
|
|
144
|
+
accessToken: string;
|
|
145
|
+
walletId: string;
|
|
146
|
+
deviceId: string;
|
|
147
|
+
shareValue?: string;
|
|
148
|
+
};
|
|
149
|
+
type SharesDeviceResponse = {
|
|
150
|
+
id: string;
|
|
151
|
+
wallet_id: string;
|
|
152
|
+
device_id: string;
|
|
153
|
+
session_id: string;
|
|
154
|
+
created_at: string;
|
|
155
|
+
share_value?: string;
|
|
156
|
+
};
|
|
157
|
+
interface MoonPaySignRequest {
|
|
158
|
+
publishableKey: string;
|
|
159
|
+
accessToken: string;
|
|
160
|
+
publicAddress: string;
|
|
161
|
+
currencyCode: string;
|
|
162
|
+
quoteCurrencyAmount: number;
|
|
163
|
+
useSandbox?: boolean;
|
|
164
|
+
}
|
|
165
|
+
interface MoonPaySignResponse {
|
|
166
|
+
external_transaction_id: string;
|
|
167
|
+
url: string;
|
|
168
|
+
signature: string;
|
|
169
|
+
signed_url: string;
|
|
170
|
+
provider: string;
|
|
171
|
+
provider_publishable_key: string;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
interface BaseTokenClaims {
|
|
175
|
+
/** Subject — the MoonX user id. */
|
|
176
|
+
sub: string;
|
|
177
|
+
/** Audience — the MoonX app id this token was issued for. */
|
|
178
|
+
aud: string | string[];
|
|
179
|
+
/** Issuer — the MoonX deployment that signed the token. */
|
|
180
|
+
iss: string;
|
|
181
|
+
/** Issued-at — epoch seconds. */
|
|
182
|
+
iat: number;
|
|
183
|
+
/** Expiry — epoch seconds. */
|
|
184
|
+
exp: number;
|
|
185
|
+
}
|
|
186
|
+
interface AccessTokenClaims extends BaseTokenClaims {
|
|
187
|
+
/** Session id — distinguishes parallel sessions for the same subject. */
|
|
188
|
+
sid: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Identity-token claims. Standard OIDC profile fields are typed; any
|
|
192
|
+
* additional fields the backend signs are still present via the index
|
|
193
|
+
* signature.
|
|
194
|
+
*
|
|
195
|
+
* All profile fields are optional — social-login users who haven't
|
|
196
|
+
* filled out a profile yet, or email-OTP users who only gave an email,
|
|
197
|
+
* may have only the BaseTokenClaims populated.
|
|
198
|
+
*/
|
|
199
|
+
interface IdentityTokenClaims extends BaseTokenClaims {
|
|
200
|
+
email?: string;
|
|
201
|
+
email_verified?: boolean;
|
|
202
|
+
name?: string;
|
|
203
|
+
given_name?: string;
|
|
204
|
+
family_name?: string;
|
|
205
|
+
picture?: string;
|
|
206
|
+
[key: string]: unknown;
|
|
207
|
+
}
|
|
208
|
+
/** Result of `@moon-x/node-sdk`'s `client.auth.verifySession(...)`. */
|
|
209
|
+
interface VerifiedSession {
|
|
210
|
+
access: AccessTokenClaims;
|
|
211
|
+
identity: IdentityTokenClaims | null;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
type MessageTypeProperty = {
|
|
215
|
+
name: string;
|
|
216
|
+
type: string;
|
|
217
|
+
};
|
|
218
|
+
type MessageTypes = {
|
|
219
|
+
[additionalProperties: string]: MessageTypeProperty[];
|
|
220
|
+
};
|
|
221
|
+
type TypedMessage<T extends MessageTypes> = {
|
|
222
|
+
types: T;
|
|
223
|
+
primaryType: keyof T;
|
|
224
|
+
domain: {
|
|
225
|
+
name?: string;
|
|
226
|
+
version?: string;
|
|
227
|
+
chainId?: number;
|
|
228
|
+
verifyingContract?: string;
|
|
229
|
+
salt?: ArrayBuffer;
|
|
230
|
+
};
|
|
231
|
+
message: Record<string, unknown>;
|
|
232
|
+
};
|
|
233
|
+
type SignTypedDataParams = TypedMessage<MessageTypes>;
|
|
234
|
+
type SignTypedDataResult = {
|
|
235
|
+
signature: string;
|
|
236
|
+
};
|
|
237
|
+
type SignTypedDataError = {
|
|
238
|
+
success: false;
|
|
239
|
+
error: string;
|
|
240
|
+
};
|
|
241
|
+
type SignTypedDataResponse = SignTypedDataResult | SignTypedDataError;
|
|
242
|
+
type Sign7702AuthorizationParams = {
|
|
243
|
+
contractAddress: `0x${string}`;
|
|
244
|
+
chainId?: number;
|
|
245
|
+
nonce?: number;
|
|
246
|
+
executor?: 'self' | `0x${string}`;
|
|
247
|
+
};
|
|
248
|
+
type Sign7702AuthorizationResult = {
|
|
249
|
+
r: `0x${string}`;
|
|
250
|
+
s: `0x${string}`;
|
|
251
|
+
v?: bigint;
|
|
252
|
+
yParity: number;
|
|
253
|
+
address: `0x${string}`;
|
|
254
|
+
chainId: number;
|
|
255
|
+
nonce: number;
|
|
256
|
+
};
|
|
257
|
+
type Sign7702AuthorizationError = {
|
|
258
|
+
success: false;
|
|
259
|
+
error: string;
|
|
260
|
+
};
|
|
261
|
+
type Sign7702AuthorizationResponse = Sign7702AuthorizationResult | Sign7702AuthorizationError;
|
|
262
|
+
|
|
263
|
+
interface EthereumSignMessageParams {
|
|
264
|
+
message: string;
|
|
265
|
+
wallet: PublicWallet;
|
|
266
|
+
requireFreshAssertion?: boolean;
|
|
267
|
+
options?: {
|
|
268
|
+
uiOptions?: {
|
|
269
|
+
title?: string;
|
|
270
|
+
description?: string;
|
|
271
|
+
showWalletUI?: boolean;
|
|
272
|
+
logoUrl?: string;
|
|
273
|
+
confirmButtonText?: string;
|
|
274
|
+
waitBeforeCloseTime?: number;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
interface EthereumSignMessageResult {
|
|
279
|
+
signature: string;
|
|
280
|
+
}
|
|
281
|
+
interface EthereumSignTransactionParams {
|
|
282
|
+
transaction: string;
|
|
283
|
+
wallet: PublicWallet;
|
|
284
|
+
requireFreshAssertion?: boolean;
|
|
285
|
+
options?: {
|
|
286
|
+
preflightCommitment?: "finalized" | "confirmed" | "processed";
|
|
287
|
+
minContextSlot?: number;
|
|
288
|
+
uiOptions?: {
|
|
289
|
+
title?: string;
|
|
290
|
+
description?: string;
|
|
291
|
+
showWalletUI?: boolean;
|
|
292
|
+
logoUrl?: string;
|
|
293
|
+
confirmButtonText?: string;
|
|
294
|
+
cancelButtonText?: string;
|
|
295
|
+
waitBeforeCloseTime?: number;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
interface EthereumSignTransactionResult {
|
|
300
|
+
signature: `0x${string}`;
|
|
301
|
+
serializedSigned?: `0x${string}`;
|
|
302
|
+
hash?: `0x${string}`;
|
|
303
|
+
}
|
|
304
|
+
interface EthereumSignTypedDataParams {
|
|
305
|
+
domain: SignTypedDataParams["domain"];
|
|
306
|
+
types: SignTypedDataParams["types"];
|
|
307
|
+
primaryType: SignTypedDataParams["primaryType"];
|
|
308
|
+
message: SignTypedDataParams["message"];
|
|
309
|
+
wallet: PublicWallet;
|
|
310
|
+
requireFreshAssertion?: boolean;
|
|
311
|
+
options?: {
|
|
312
|
+
uiOptions?: any;
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
interface EthereumSignTypedDataResult {
|
|
316
|
+
signature: `0x${string}`;
|
|
317
|
+
}
|
|
318
|
+
interface EthereumSignHashParams {
|
|
319
|
+
hash: `0x${string}` | string;
|
|
320
|
+
wallet: PublicWallet;
|
|
321
|
+
requireFreshAssertion?: boolean;
|
|
322
|
+
options?: {
|
|
323
|
+
uiOptions?: any;
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
interface EthereumSignHashResult {
|
|
327
|
+
signature: `0x${string}`;
|
|
328
|
+
}
|
|
329
|
+
interface EthereumSign7702AuthorizationParams {
|
|
330
|
+
contractAddress: `0x${string}`;
|
|
331
|
+
chainId?: number;
|
|
332
|
+
nonce?: number;
|
|
333
|
+
executor?: "self" | `0x${string}`;
|
|
334
|
+
wallet: PublicWallet;
|
|
335
|
+
requireFreshAssertion?: boolean;
|
|
336
|
+
options?: {
|
|
337
|
+
uiOptions?: any;
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
interface EthereumSign7702AuthorizationResult {
|
|
341
|
+
r: `0x${string}`;
|
|
342
|
+
s: `0x${string}`;
|
|
343
|
+
v?: bigint;
|
|
344
|
+
yParity: number;
|
|
345
|
+
address: `0x${string}`;
|
|
346
|
+
chainId: number;
|
|
347
|
+
nonce: number;
|
|
348
|
+
}
|
|
349
|
+
interface EthereumSendTransactionParams {
|
|
350
|
+
transaction: {
|
|
351
|
+
to?: string;
|
|
352
|
+
value?: string | number | bigint;
|
|
353
|
+
nonce?: string | number | bigint;
|
|
354
|
+
gasLimit?: string | number | bigint;
|
|
355
|
+
gasPrice?: string | number | bigint;
|
|
356
|
+
data?: string;
|
|
357
|
+
chainId?: number;
|
|
358
|
+
type?: number;
|
|
359
|
+
maxPriorityFeePerGas?: string | number | bigint;
|
|
360
|
+
maxFeePerGas?: string | number | bigint;
|
|
361
|
+
};
|
|
362
|
+
wallet: PublicWallet;
|
|
363
|
+
rpcUrl: string;
|
|
364
|
+
requireFreshAssertion?: boolean;
|
|
365
|
+
options?: {
|
|
366
|
+
commitment?: TransactionCommitment;
|
|
367
|
+
skipPreflight?: boolean;
|
|
368
|
+
maxRetries?: number;
|
|
369
|
+
encoding?: TransactionEncoding;
|
|
370
|
+
replaceRecentBlockhash?: boolean;
|
|
371
|
+
sigVerify?: boolean;
|
|
372
|
+
minContextSlot?: number;
|
|
373
|
+
innerInstructions?: boolean;
|
|
374
|
+
accounts?: any[];
|
|
375
|
+
network?: string;
|
|
376
|
+
uiOptions?: {
|
|
377
|
+
title?: string;
|
|
378
|
+
description?: string;
|
|
379
|
+
buttonText?: string;
|
|
380
|
+
showWalletUI?: boolean;
|
|
381
|
+
transactionInfo?: TransactionUIOptions;
|
|
382
|
+
successHeader?: string;
|
|
383
|
+
successDescription?: string;
|
|
384
|
+
isCancellable?: boolean;
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
interface EthereumSendTransactionResult {
|
|
389
|
+
hash: `0x${string}`;
|
|
390
|
+
}
|
|
391
|
+
interface EthereumGetBalanceParams {
|
|
392
|
+
wallet: PublicWallet;
|
|
393
|
+
chainId?: number;
|
|
394
|
+
rpcUrl: string;
|
|
395
|
+
options?: {
|
|
396
|
+
commitment?: string;
|
|
397
|
+
minContextSlot?: number;
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
interface EthereumGetBalanceResult {
|
|
401
|
+
balanceBaseUnit: string;
|
|
402
|
+
balanceNativeUnit: string;
|
|
403
|
+
walletAddress: string;
|
|
404
|
+
network: string;
|
|
405
|
+
}
|
|
406
|
+
interface EthereumGetTokenAccountsByOwnerParams {
|
|
407
|
+
rpcUrl: string;
|
|
408
|
+
wallet: PublicWallet;
|
|
409
|
+
mint?: string;
|
|
410
|
+
programId?: string;
|
|
411
|
+
options?: any;
|
|
412
|
+
}
|
|
413
|
+
interface EthereumGetTokenAccountsByOwnerResult {
|
|
414
|
+
walletAddress: string;
|
|
415
|
+
walletType: string;
|
|
416
|
+
tokenAccounts: any[];
|
|
417
|
+
}
|
|
418
|
+
interface EthereumSwitchChainParams {
|
|
419
|
+
wallet: PublicWallet;
|
|
420
|
+
chainId: number;
|
|
421
|
+
options?: {
|
|
422
|
+
uiOptions?: {
|
|
423
|
+
title?: string;
|
|
424
|
+
description?: string;
|
|
425
|
+
showWalletUI?: boolean;
|
|
426
|
+
logoUrl?: string;
|
|
427
|
+
confirmButtonText?: string;
|
|
428
|
+
footerText?: string;
|
|
429
|
+
waitBeforeCloseTime?: number;
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
type FundingMethod = 'moonpay' | 'external';
|
|
435
|
+
type PreferredCardProvider = 'moonpay';
|
|
436
|
+
type DefaultFundingMethod = 'card' | 'exchange' | 'wallet' | 'manual';
|
|
437
|
+
type SolanaChain$1 = 'solana:mainnet' | 'solana:devnet' | 'solana:testnet';
|
|
438
|
+
type Hex = `0x${string}`;
|
|
439
|
+
type FundingUIConfig = {
|
|
440
|
+
receiveFundsTitle?: string;
|
|
441
|
+
receiveFundsSubtitle?: string;
|
|
442
|
+
landing?: {
|
|
443
|
+
title?: string;
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
type SolanaFundingConfig = {
|
|
447
|
+
cluster?: SolanaChain$1;
|
|
448
|
+
amount?: string;
|
|
449
|
+
defaultFundingMethod?: DefaultFundingMethod;
|
|
450
|
+
card?: {
|
|
451
|
+
preferredProvider?: PreferredCardProvider;
|
|
452
|
+
};
|
|
453
|
+
uiConfig?: FundingUIConfig;
|
|
454
|
+
asset?: 'native' | 'USDC';
|
|
455
|
+
useSandbox?: boolean;
|
|
456
|
+
};
|
|
457
|
+
type EthereumFundingConfig = {
|
|
458
|
+
chain?: ChainLikeWithId;
|
|
459
|
+
amount?: string;
|
|
460
|
+
defaultFundingMethod?: DefaultFundingMethod;
|
|
461
|
+
card?: {
|
|
462
|
+
preferredProvider?: PreferredCardProvider;
|
|
463
|
+
};
|
|
464
|
+
uiConfig?: FundingUIConfig;
|
|
465
|
+
useSandbox?: boolean;
|
|
466
|
+
} | {
|
|
467
|
+
chain?: ChainLikeWithId;
|
|
468
|
+
amount: string;
|
|
469
|
+
asset: {
|
|
470
|
+
erc20: Hex;
|
|
471
|
+
} | 'USDC' | 'native';
|
|
472
|
+
defaultFundingMethod?: DefaultFundingMethod;
|
|
473
|
+
card?: {
|
|
474
|
+
preferredProvider?: PreferredCardProvider;
|
|
475
|
+
};
|
|
476
|
+
uiConfig?: FundingUIConfig;
|
|
477
|
+
useSandbox?: boolean;
|
|
478
|
+
};
|
|
479
|
+
type FundWalletConfig = SolanaFundingConfig | EthereumFundingConfig;
|
|
480
|
+
interface FundingEvents {
|
|
481
|
+
fundEthereumWallet: {
|
|
482
|
+
onUserExited?: (params: {
|
|
483
|
+
address: string;
|
|
484
|
+
chain: Chain;
|
|
485
|
+
fundingMethod: FundingMethod | 'manual' | null;
|
|
486
|
+
balance: bigint | undefined;
|
|
487
|
+
}) => void;
|
|
488
|
+
};
|
|
489
|
+
fundSolanaWallet: {
|
|
490
|
+
onUserExited?: (params: {
|
|
491
|
+
address: string;
|
|
492
|
+
fundingMethod: FundingMethod | 'manual' | null;
|
|
493
|
+
chain: SolanaChain$1;
|
|
494
|
+
balance: bigint | undefined;
|
|
495
|
+
}) => void;
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
interface UseFundWalletInterface {
|
|
499
|
+
fundWallet: ({ address, options }: {
|
|
500
|
+
address: string;
|
|
501
|
+
options?: FundWalletConfig;
|
|
502
|
+
}) => Promise<void>;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
interface SolanaSignMessageParams {
|
|
506
|
+
message: string;
|
|
507
|
+
wallet: PublicWallet;
|
|
508
|
+
requireFreshAssertion?: boolean;
|
|
509
|
+
options?: {
|
|
510
|
+
uiOptions?: {
|
|
511
|
+
title?: string;
|
|
512
|
+
description?: string;
|
|
513
|
+
showWalletUI?: boolean;
|
|
514
|
+
logoUrl?: string;
|
|
515
|
+
confirmButtonText?: string;
|
|
516
|
+
cancelButtonText?: string;
|
|
517
|
+
waitBeforeCloseTime?: number;
|
|
518
|
+
};
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
interface SolanaSignMessageResult {
|
|
522
|
+
signature: Uint8Array;
|
|
523
|
+
}
|
|
524
|
+
interface SolanaSignTransactionParams {
|
|
525
|
+
transaction: string;
|
|
526
|
+
wallet: PublicWallet;
|
|
527
|
+
requireFreshAssertion?: boolean;
|
|
528
|
+
options?: {
|
|
529
|
+
preflightCommitment?: "finalized" | "confirmed" | "processed";
|
|
530
|
+
minContextSlot?: number;
|
|
531
|
+
uiOptions?: {
|
|
532
|
+
title?: string;
|
|
533
|
+
description?: string;
|
|
534
|
+
showWalletUI?: boolean;
|
|
535
|
+
logoUrl?: string;
|
|
536
|
+
cancelButtonText?: string;
|
|
537
|
+
confirmButtonText?: string;
|
|
538
|
+
footerText?: string;
|
|
539
|
+
waitBeforeCloseTime?: number;
|
|
540
|
+
};
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
interface SolanaSignTransactionResult {
|
|
544
|
+
signedTransaction: Uint8Array;
|
|
545
|
+
}
|
|
546
|
+
interface SolanaSendTransactionParams {
|
|
547
|
+
transaction: string;
|
|
548
|
+
wallet: PublicWallet;
|
|
549
|
+
rpcUrl: string;
|
|
550
|
+
requireFreshAssertion?: boolean;
|
|
551
|
+
options?: {
|
|
552
|
+
commitment?: TransactionCommitment;
|
|
553
|
+
skipPreflight?: boolean;
|
|
554
|
+
maxRetries?: number;
|
|
555
|
+
encoding?: TransactionEncoding;
|
|
556
|
+
replaceRecentBlockhash?: boolean;
|
|
557
|
+
sigVerify?: boolean;
|
|
558
|
+
minContextSlot?: number;
|
|
559
|
+
innerInstructions?: boolean;
|
|
560
|
+
accounts?: any[];
|
|
561
|
+
network?: string;
|
|
562
|
+
wsEndpoint?: string;
|
|
563
|
+
uiOptions?: {
|
|
564
|
+
title?: string;
|
|
565
|
+
description?: string;
|
|
566
|
+
buttonText?: string;
|
|
567
|
+
showWalletUI?: boolean;
|
|
568
|
+
transactionInfo?: TransactionUIOptions;
|
|
569
|
+
successHeader?: string;
|
|
570
|
+
successDescription?: string;
|
|
571
|
+
isCancellable?: boolean;
|
|
572
|
+
};
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
interface SolanaSendTransactionResult {
|
|
576
|
+
signature: Uint8Array;
|
|
577
|
+
}
|
|
578
|
+
interface SolanaGetBalanceParams {
|
|
579
|
+
wallet: PublicWallet;
|
|
580
|
+
chain?: SolanaChain;
|
|
581
|
+
rpcUrl: string;
|
|
582
|
+
options?: {
|
|
583
|
+
commitment?: string;
|
|
584
|
+
minContextSlot?: number;
|
|
585
|
+
wsEndpoint?: string;
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
interface SolanaGetBalanceResult {
|
|
589
|
+
balanceBaseUnit: string;
|
|
590
|
+
balanceNativeUnit: string;
|
|
591
|
+
walletAddress: string;
|
|
592
|
+
network: string;
|
|
593
|
+
}
|
|
594
|
+
interface SolanaGetTokenAccountsByOwnerParams {
|
|
595
|
+
rpcUrl: string;
|
|
596
|
+
wallet: PublicWallet;
|
|
597
|
+
mint?: string;
|
|
598
|
+
programId?: string;
|
|
599
|
+
options?: {
|
|
600
|
+
commitment?: string;
|
|
601
|
+
minContextSlot?: number;
|
|
602
|
+
dataSlice?: any;
|
|
603
|
+
encoding?: string;
|
|
604
|
+
wsEndpoint?: string;
|
|
605
|
+
[key: string]: any;
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
interface SolanaGetTokenAccountsByOwnerResult {
|
|
609
|
+
walletAddress: string;
|
|
610
|
+
walletType: string;
|
|
611
|
+
tokenAccounts: any[];
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
type EmailOtpFlowState = {
|
|
615
|
+
status: "start";
|
|
616
|
+
} | {
|
|
617
|
+
status: "error";
|
|
618
|
+
error: Error | null;
|
|
619
|
+
} | {
|
|
620
|
+
status: "sending-code";
|
|
621
|
+
} | {
|
|
622
|
+
status: "waiting-code-input";
|
|
623
|
+
} | {
|
|
624
|
+
status: "verifying-code";
|
|
625
|
+
} | {
|
|
626
|
+
status: "complete";
|
|
627
|
+
};
|
|
628
|
+
/**
|
|
629
|
+
* Display mode type for theme switching
|
|
630
|
+
*/
|
|
631
|
+
type DisplayMode = "light" | "dark" | "auto";
|
|
632
|
+
interface AuthAppearance {
|
|
633
|
+
hideClose?: boolean;
|
|
634
|
+
loginHeaderTitle?: string;
|
|
635
|
+
loginHeaderDescription?: string;
|
|
636
|
+
logo?: string;
|
|
637
|
+
backgroundColor?: string;
|
|
638
|
+
accentColor?: string;
|
|
639
|
+
displayMode?: DisplayMode;
|
|
640
|
+
/** Border radius preset or explicit per-size overrides */
|
|
641
|
+
borderRadius?: 'none' | 'sm' | 'md' | 'lg' | {
|
|
642
|
+
sm?: string;
|
|
643
|
+
md?: string;
|
|
644
|
+
lg?: string;
|
|
645
|
+
};
|
|
646
|
+
fontFamily?: string;
|
|
647
|
+
/** Fine-grained color overrides — applied after accent/background derivations */
|
|
648
|
+
colors?: {
|
|
649
|
+
accentForeground?: string;
|
|
650
|
+
foreground?: string;
|
|
651
|
+
foreground2?: string;
|
|
652
|
+
foreground3?: string;
|
|
653
|
+
foreground4?: string;
|
|
654
|
+
foregroundAccent?: string;
|
|
655
|
+
border?: string;
|
|
656
|
+
error?: string;
|
|
657
|
+
errorForeground?: string;
|
|
658
|
+
errorLight?: string;
|
|
659
|
+
success?: string;
|
|
660
|
+
successForeground?: string;
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
interface MoonKeyThemeConfig {
|
|
664
|
+
colors?: {
|
|
665
|
+
accent?: string;
|
|
666
|
+
accentForeground?: string;
|
|
667
|
+
accentDark?: string;
|
|
668
|
+
accentDarkest?: string;
|
|
669
|
+
accentLight?: string;
|
|
670
|
+
accentLightest?: string;
|
|
671
|
+
background?: string;
|
|
672
|
+
background2?: string;
|
|
673
|
+
background3?: string;
|
|
674
|
+
foreground?: string;
|
|
675
|
+
foreground2?: string;
|
|
676
|
+
foreground3?: string;
|
|
677
|
+
foreground4?: string;
|
|
678
|
+
foregroundAccent?: string;
|
|
679
|
+
success?: string;
|
|
680
|
+
successForeground?: string;
|
|
681
|
+
error?: string;
|
|
682
|
+
errorForeground?: string;
|
|
683
|
+
errorLight?: string;
|
|
684
|
+
border?: string;
|
|
685
|
+
};
|
|
686
|
+
borderRadius?: {
|
|
687
|
+
sm?: string;
|
|
688
|
+
md?: string;
|
|
689
|
+
lg?: string;
|
|
690
|
+
full?: string;
|
|
691
|
+
};
|
|
692
|
+
fontFamily?: string;
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Flexible theme type that accepts both strict MoonKeyTheme and loose config theme objects.
|
|
696
|
+
* Used for functions that need to work with various theme configuration formats.
|
|
697
|
+
*/
|
|
698
|
+
type FlexibleTheme = {
|
|
699
|
+
colors?: {
|
|
700
|
+
background?: string;
|
|
701
|
+
foreground?: string;
|
|
702
|
+
accent?: string;
|
|
703
|
+
[key: string]: string | undefined;
|
|
704
|
+
};
|
|
705
|
+
borderRadius?: {
|
|
706
|
+
[key: string]: string | undefined;
|
|
707
|
+
};
|
|
708
|
+
fontFamily?: string;
|
|
709
|
+
[key: string]: any;
|
|
710
|
+
};
|
|
711
|
+
type AuthFlow = "landing" | "email" | "sign-message" | "export-key" | "import-key" | "sign-transaction" | "send-transaction" | "send-ethereum-transaction" | "oauth" | "passkey-enroll" | "add-passkey" | "external-wallet" | "connect-wallet" | "connect-ethereum-wallet" | "wallets-combined" | "sign-typed-data" | "sign-7702-authorization" | "funding";
|
|
712
|
+
type AuthLoginMethod = "wallet" | "email" | "sms" | "google" | "twitter" | "discord" | "github" | "linkedin" | "spotify" | "instagram" | "tiktok" | "line" | "apple" | "farcaster" | "telegram";
|
|
713
|
+
type AuthFlowComponent = "landing" | "email_otp";
|
|
714
|
+
type SolanaChain = "solana:mainnet" | "solana:devnet" | "solana:testnet";
|
|
715
|
+
interface PasskeyEnrollConfig {
|
|
716
|
+
uiConfig?: {
|
|
717
|
+
title?: string;
|
|
718
|
+
description?: string;
|
|
719
|
+
logoUrl?: string;
|
|
720
|
+
confirmButtonText?: string;
|
|
721
|
+
skipButtonText?: string;
|
|
722
|
+
successTitle?: string;
|
|
723
|
+
successDescription?: string;
|
|
724
|
+
successDoneButtonText?: string;
|
|
725
|
+
required?: boolean;
|
|
726
|
+
};
|
|
727
|
+
displayName?: string;
|
|
728
|
+
}
|
|
729
|
+
interface EmailOtpConfig {
|
|
730
|
+
skipVerifiedSuccess?: boolean;
|
|
731
|
+
expiresIn?: number;
|
|
732
|
+
verifiedDisplayTime?: number;
|
|
733
|
+
verifyEmailTitle?: string;
|
|
734
|
+
verifyEmailResendTitle?: string;
|
|
735
|
+
resendCodeTime?: number;
|
|
736
|
+
verifiedNewUserMessage?: string;
|
|
737
|
+
verifiedExistingUserMessage?: string;
|
|
738
|
+
verifiedSuccessMessage?: string;
|
|
739
|
+
}
|
|
740
|
+
interface SignMessageConfig {
|
|
741
|
+
uiConfig?: {
|
|
742
|
+
logoUrl?: string;
|
|
743
|
+
title?: string;
|
|
744
|
+
description?: string;
|
|
745
|
+
confirmButtonText?: string;
|
|
746
|
+
waitBeforeCloseTime?: number;
|
|
747
|
+
showWalletUI?: boolean;
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
interface SignTransactionConfig {
|
|
751
|
+
uiConfig?: {
|
|
752
|
+
logoUrl?: string;
|
|
753
|
+
title?: string;
|
|
754
|
+
description?: string;
|
|
755
|
+
confirmButtonText?: string;
|
|
756
|
+
footerText?: string;
|
|
757
|
+
waitBeforeCloseTime?: number;
|
|
758
|
+
showWalletUI?: boolean;
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
interface SendTransactionConfig {
|
|
762
|
+
uiConfig?: {
|
|
763
|
+
logoUrl?: string;
|
|
764
|
+
title?: string;
|
|
765
|
+
description?: string;
|
|
766
|
+
confirmButtonText?: string;
|
|
767
|
+
cancelButtonText?: string;
|
|
768
|
+
waitBeforeCloseTime?: number;
|
|
769
|
+
showWalletUI?: boolean;
|
|
770
|
+
advancedTransaction: {
|
|
771
|
+
title?: string;
|
|
772
|
+
closeButtonText?: string;
|
|
773
|
+
};
|
|
774
|
+
success: {
|
|
775
|
+
title?: string;
|
|
776
|
+
description?: string;
|
|
777
|
+
};
|
|
778
|
+
failed: {
|
|
779
|
+
title?: string;
|
|
780
|
+
description?: string;
|
|
781
|
+
errorTitle?: string;
|
|
782
|
+
closeButtonText?: string;
|
|
783
|
+
};
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
interface ExportKeyConfig {
|
|
787
|
+
uiConfig?: {
|
|
788
|
+
title?: string;
|
|
789
|
+
hdDescription?: string;
|
|
790
|
+
privateKeyDescription?: string;
|
|
791
|
+
neverShareDescription?: string;
|
|
792
|
+
loadingExportOptionsText?: string;
|
|
793
|
+
logoUrl?: string;
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
type WalletChain = "solana" | "ethereum";
|
|
797
|
+
interface MethodDetails {
|
|
798
|
+
id: string;
|
|
799
|
+
method_id: string;
|
|
800
|
+
method_type: string;
|
|
801
|
+
email_id?: string;
|
|
802
|
+
email?: string;
|
|
803
|
+
phone_number_id?: string;
|
|
804
|
+
phone_number?: string;
|
|
805
|
+
provider_subject?: string;
|
|
806
|
+
last_verified_at: number;
|
|
807
|
+
}
|
|
808
|
+
interface Factor {
|
|
809
|
+
delivery_channel: string;
|
|
810
|
+
type: string;
|
|
811
|
+
method: MethodDetails;
|
|
812
|
+
}
|
|
813
|
+
interface DeviceFingerprint {
|
|
814
|
+
user_agent: string;
|
|
815
|
+
ip: string;
|
|
816
|
+
}
|
|
817
|
+
interface Email {
|
|
818
|
+
id: string;
|
|
819
|
+
verified: boolean;
|
|
820
|
+
email: string;
|
|
821
|
+
updated_at: number;
|
|
822
|
+
created_at: number;
|
|
823
|
+
}
|
|
824
|
+
interface IdpProvider {
|
|
825
|
+
id: string;
|
|
826
|
+
provider: string;
|
|
827
|
+
provider_subject: string;
|
|
828
|
+
idp_type: string;
|
|
829
|
+
user_id: string;
|
|
830
|
+
method_id: string;
|
|
831
|
+
method_type: string;
|
|
832
|
+
picture_url?: string;
|
|
833
|
+
locale?: string;
|
|
834
|
+
updated_at: number;
|
|
835
|
+
created_at: number;
|
|
836
|
+
}
|
|
837
|
+
interface Wallet {
|
|
838
|
+
id: string;
|
|
839
|
+
app_id: string;
|
|
840
|
+
user_id: string;
|
|
841
|
+
key_id: string;
|
|
842
|
+
public_address: string;
|
|
843
|
+
wallet_type: string;
|
|
844
|
+
algorithm: string;
|
|
845
|
+
derivation_path?: string;
|
|
846
|
+
created_at: string;
|
|
847
|
+
}
|
|
848
|
+
type WalletChainType = "ethereum" | "solana" | "ethereum-or-solana";
|
|
849
|
+
interface PrefillConfig {
|
|
850
|
+
type: "email";
|
|
851
|
+
value: string;
|
|
852
|
+
}
|
|
853
|
+
interface WalletConnectConfig {
|
|
854
|
+
name: string;
|
|
855
|
+
description: string;
|
|
856
|
+
url: string;
|
|
857
|
+
icons: string[];
|
|
858
|
+
}
|
|
859
|
+
interface WalletListEntry {
|
|
860
|
+
id: string;
|
|
861
|
+
name: string;
|
|
862
|
+
icon?: string;
|
|
863
|
+
}
|
|
864
|
+
interface AuthProviderConfig {
|
|
865
|
+
publishableKey: string;
|
|
866
|
+
embeddableId?: string;
|
|
867
|
+
children?: any;
|
|
868
|
+
hideIframe?: boolean;
|
|
869
|
+
onComplete?: (result: any) => void;
|
|
870
|
+
config?: {
|
|
871
|
+
appearance?: AuthAppearance;
|
|
872
|
+
loginMethods?: AuthLoginMethod[];
|
|
873
|
+
prefill?: PrefillConfig;
|
|
874
|
+
walletChainType?: WalletChainType;
|
|
875
|
+
isDark?: boolean;
|
|
876
|
+
theme?: MoonKeyThemeConfig;
|
|
877
|
+
emailConfig?: EmailOtpConfig;
|
|
878
|
+
passkeyEnrollConfig?: PasskeyEnrollConfig;
|
|
879
|
+
signMessageConfig?: SignMessageConfig;
|
|
880
|
+
exportKeyConfig?: ExportKeyConfig;
|
|
881
|
+
signTransactionConfig?: SignTransactionConfig;
|
|
882
|
+
sendTransactionConfig?: SendTransactionConfig;
|
|
883
|
+
solana?: {
|
|
884
|
+
rpcs: {
|
|
885
|
+
[key: string]: {
|
|
886
|
+
rpc: string;
|
|
887
|
+
rpcSubscriptions?: string;
|
|
888
|
+
};
|
|
889
|
+
};
|
|
890
|
+
};
|
|
891
|
+
ethereum?: {
|
|
892
|
+
defaultChain?: Chain;
|
|
893
|
+
supportedChains?: Chain[];
|
|
894
|
+
};
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
interface SendEmailOtpRequest {
|
|
898
|
+
publishableKey: string;
|
|
899
|
+
email: string;
|
|
900
|
+
expiresIn?: number;
|
|
901
|
+
}
|
|
902
|
+
interface VerifyEmailOtpRequest {
|
|
903
|
+
publishableKey: string;
|
|
904
|
+
email: string;
|
|
905
|
+
code: string;
|
|
906
|
+
}
|
|
907
|
+
interface SendEmailOtpResponse {
|
|
908
|
+
ok: boolean;
|
|
909
|
+
}
|
|
910
|
+
interface VerifyEmailOtpUser {
|
|
911
|
+
id: string;
|
|
912
|
+
email: string;
|
|
913
|
+
first_name?: string;
|
|
914
|
+
last_name?: string;
|
|
915
|
+
display_name?: string;
|
|
916
|
+
profile_image_url?: string;
|
|
917
|
+
}
|
|
918
|
+
interface LoginTokenBundle {
|
|
919
|
+
access_token: string;
|
|
920
|
+
identity_token: string;
|
|
921
|
+
refresh_token: string;
|
|
922
|
+
expires_at: number;
|
|
923
|
+
}
|
|
924
|
+
interface VerifyEmailOtpResponse extends LoginTokenBundle {
|
|
925
|
+
user: VerifyEmailOtpUser;
|
|
926
|
+
}
|
|
927
|
+
interface RefreshSessionRequest {
|
|
928
|
+
publishableKey: string;
|
|
929
|
+
refreshToken: string;
|
|
930
|
+
}
|
|
931
|
+
type RefreshSessionResponse = LoginTokenBundle;
|
|
932
|
+
interface AppConfigRequest {
|
|
933
|
+
publishableKey: string;
|
|
934
|
+
}
|
|
935
|
+
interface SdkSettings {
|
|
936
|
+
enabled: boolean;
|
|
937
|
+
whitelisted_domains: string[] | null;
|
|
938
|
+
whitelisted_email_domains: string[] | null;
|
|
939
|
+
blacklisted_email_domains: string[] | null;
|
|
940
|
+
email_otp_enabled: boolean;
|
|
941
|
+
google_oauth_enabled: boolean;
|
|
942
|
+
apple_oauth_enabled: boolean;
|
|
943
|
+
enable_external_wallets: boolean;
|
|
944
|
+
allow_wallet_export: boolean;
|
|
945
|
+
enable_user_update: boolean;
|
|
946
|
+
}
|
|
947
|
+
interface SmsSettings {
|
|
948
|
+
enable_custom_provider: boolean;
|
|
949
|
+
sms_templates: any | null;
|
|
950
|
+
providers: any | null;
|
|
951
|
+
}
|
|
952
|
+
interface OnrampFundingSettings {
|
|
953
|
+
methods: [
|
|
954
|
+
{
|
|
955
|
+
method: string;
|
|
956
|
+
provider: string;
|
|
957
|
+
}
|
|
958
|
+
];
|
|
959
|
+
default_currency: {
|
|
960
|
+
chain: string;
|
|
961
|
+
asset_symbol: string;
|
|
962
|
+
};
|
|
963
|
+
default_amount: string;
|
|
964
|
+
}
|
|
965
|
+
interface PasskeySettings {
|
|
966
|
+
rp_id: string;
|
|
967
|
+
}
|
|
968
|
+
interface AppConfigResponse {
|
|
969
|
+
id: string;
|
|
970
|
+
name: string;
|
|
971
|
+
description: string;
|
|
972
|
+
organization_id: string;
|
|
973
|
+
env_type: "test" | "live";
|
|
974
|
+
active: boolean;
|
|
975
|
+
logo_path: string;
|
|
976
|
+
external_logo_url?: string;
|
|
977
|
+
display_logo: boolean;
|
|
978
|
+
sdk_settings: SdkSettings;
|
|
979
|
+
sms_settings?: SmsSettings;
|
|
980
|
+
passkeys: PasskeySettings;
|
|
981
|
+
oauth_callback: string | null;
|
|
982
|
+
public_logo_url: string;
|
|
983
|
+
updated_at: string;
|
|
984
|
+
created_at: string;
|
|
985
|
+
wallet_connect_cloud_project_id: string;
|
|
986
|
+
onramp_funding_settings: OnrampFundingSettings;
|
|
987
|
+
privacy_policy_url: string;
|
|
988
|
+
terms_of_service_url: string;
|
|
989
|
+
require_users_accept_terms: boolean;
|
|
990
|
+
enable_captcha?: boolean;
|
|
991
|
+
captcha_sitekey?: string;
|
|
992
|
+
}
|
|
993
|
+
interface UsersMeRequest {
|
|
994
|
+
publishableKey: string;
|
|
995
|
+
accessToken: string;
|
|
996
|
+
}
|
|
997
|
+
interface MpcKeyShares {
|
|
998
|
+
id: string;
|
|
999
|
+
encrypted_combined_value: string;
|
|
1000
|
+
share_index: number;
|
|
1001
|
+
}
|
|
1002
|
+
interface UsersMeResponse {
|
|
1003
|
+
user_id: string;
|
|
1004
|
+
app_id: string;
|
|
1005
|
+
first_name?: string;
|
|
1006
|
+
last_name?: string;
|
|
1007
|
+
display_name?: string;
|
|
1008
|
+
profile_image_url?: string;
|
|
1009
|
+
status?: string;
|
|
1010
|
+
created_at?: string;
|
|
1011
|
+
emails: Email[];
|
|
1012
|
+
wallets: PublicWallet[];
|
|
1013
|
+
}
|
|
1014
|
+
interface UsersMePublicResponse {
|
|
1015
|
+
user_id: string;
|
|
1016
|
+
app_id: string;
|
|
1017
|
+
first_name?: string;
|
|
1018
|
+
last_name?: string;
|
|
1019
|
+
display_name?: string;
|
|
1020
|
+
profile_image_url?: string;
|
|
1021
|
+
status?: string;
|
|
1022
|
+
created_at?: string;
|
|
1023
|
+
emails: Email[];
|
|
1024
|
+
wallets: PublicWallet[];
|
|
1025
|
+
}
|
|
1026
|
+
interface CreateWalletResponse {
|
|
1027
|
+
id: string;
|
|
1028
|
+
app_id: string;
|
|
1029
|
+
user_id: string;
|
|
1030
|
+
public_address: string;
|
|
1031
|
+
wallet_type: string;
|
|
1032
|
+
algorithm: string;
|
|
1033
|
+
derivation_path: string;
|
|
1034
|
+
created_at: string;
|
|
1035
|
+
}
|
|
1036
|
+
declare enum WalletCreationError {
|
|
1037
|
+
SESSION_INVALID = "Session is invalid - cannot create wallet",
|
|
1038
|
+
FAILED_TO_CREATE_WALLET = "Failed to create wallet"
|
|
1039
|
+
}
|
|
1040
|
+
interface RetrieveWalletKeyRequest {
|
|
1041
|
+
publishableKey: string;
|
|
1042
|
+
accessToken: string;
|
|
1043
|
+
encryptedAesKey: string;
|
|
1044
|
+
kmsKeyId: string;
|
|
1045
|
+
}
|
|
1046
|
+
interface RetrieveWalletKeyResponse {
|
|
1047
|
+
key: string;
|
|
1048
|
+
}
|
|
1049
|
+
interface WalletKeyRequest {
|
|
1050
|
+
publishableKey: string;
|
|
1051
|
+
accessToken: string;
|
|
1052
|
+
walletType: string;
|
|
1053
|
+
}
|
|
1054
|
+
interface LogoutRequest {
|
|
1055
|
+
publishableKey: string;
|
|
1056
|
+
}
|
|
1057
|
+
interface LogoutResponse {
|
|
1058
|
+
success: boolean;
|
|
1059
|
+
message: string;
|
|
1060
|
+
}
|
|
1061
|
+
interface GetCurrentSessionRequest {
|
|
1062
|
+
publishableKey: string;
|
|
1063
|
+
}
|
|
1064
|
+
interface GetCurrentSessionResponse {
|
|
1065
|
+
success: boolean;
|
|
1066
|
+
session: SessionData | null;
|
|
1067
|
+
error?: string;
|
|
1068
|
+
}
|
|
1069
|
+
interface SessionData {
|
|
1070
|
+
accessToken: string;
|
|
1071
|
+
identityToken: string;
|
|
1072
|
+
refreshToken: string;
|
|
1073
|
+
expiresAt: number;
|
|
1074
|
+
publishableKey: string;
|
|
1075
|
+
}
|
|
1076
|
+
interface PublicSessionData {
|
|
1077
|
+
accessToken: string;
|
|
1078
|
+
identityToken: string;
|
|
1079
|
+
expiresAt: number;
|
|
1080
|
+
}
|
|
1081
|
+
interface DeleteSessionRequest {
|
|
1082
|
+
publishableKey: string;
|
|
1083
|
+
accessToken: string;
|
|
1084
|
+
}
|
|
1085
|
+
interface DeleteSessionResponse {
|
|
1086
|
+
message: string;
|
|
1087
|
+
}
|
|
1088
|
+
interface IsAuthenticatedRequest {
|
|
1089
|
+
publishableKey: string;
|
|
1090
|
+
}
|
|
1091
|
+
interface IsAuthenticatedResponse {
|
|
1092
|
+
isAuthenticated: boolean;
|
|
1093
|
+
}
|
|
1094
|
+
declare enum Network {
|
|
1095
|
+
Bitcoin = "bitcoin",
|
|
1096
|
+
Solana = "solana",
|
|
1097
|
+
Ripple = "ripple",
|
|
1098
|
+
Ethereum = "ethereum",
|
|
1099
|
+
Polygon = "polygon",
|
|
1100
|
+
Arbitrum = "arbitrum",
|
|
1101
|
+
Optimism = "optimism",
|
|
1102
|
+
Base = "base",
|
|
1103
|
+
ZkSync = "zksync",
|
|
1104
|
+
BinanceSmartChain = "bsc",
|
|
1105
|
+
Tron = "tron"
|
|
1106
|
+
}
|
|
1107
|
+
interface SendTransactionRequest {
|
|
1108
|
+
encodedMessage: string;
|
|
1109
|
+
walletAddress: string;
|
|
1110
|
+
transaction: string;
|
|
1111
|
+
rpcUrl: string;
|
|
1112
|
+
commitment?: "finalized" | "confirmed" | "processed";
|
|
1113
|
+
encoding?: "base64" | "jsonParsed" | "base58" | "json";
|
|
1114
|
+
replaceRecentBlockhash?: boolean;
|
|
1115
|
+
sigVerify?: boolean;
|
|
1116
|
+
minContextSlot?: number;
|
|
1117
|
+
innerInstructions?: boolean;
|
|
1118
|
+
accounts?: any[];
|
|
1119
|
+
network?: Network;
|
|
1120
|
+
}
|
|
1121
|
+
interface EthereumSendTransactionRequest {
|
|
1122
|
+
transaction: string;
|
|
1123
|
+
walletAddress: string;
|
|
1124
|
+
rpcUrl: string;
|
|
1125
|
+
network?: Network;
|
|
1126
|
+
chainId?: number;
|
|
1127
|
+
}
|
|
1128
|
+
interface OAuthRequest {
|
|
1129
|
+
publishableKey: string;
|
|
1130
|
+
login_redirect_url: string;
|
|
1131
|
+
code_challenge?: string;
|
|
1132
|
+
oauth_attach_token?: string;
|
|
1133
|
+
}
|
|
1134
|
+
interface OAuthResponse {
|
|
1135
|
+
auth_url: string;
|
|
1136
|
+
}
|
|
1137
|
+
interface VerifyOAuthTokenRequest {
|
|
1138
|
+
publishableKey: string;
|
|
1139
|
+
token: string;
|
|
1140
|
+
accessToken?: string;
|
|
1141
|
+
}
|
|
1142
|
+
interface VerifyOAuthTokenResponse extends LoginTokenBundle {
|
|
1143
|
+
user: VerifyEmailOtpUser;
|
|
1144
|
+
}
|
|
1145
|
+
interface AttachOAuthTokenRequest {
|
|
1146
|
+
publishableKey: string;
|
|
1147
|
+
accessToken: string;
|
|
1148
|
+
provider: string;
|
|
1149
|
+
}
|
|
1150
|
+
interface AttachOAuthTokenResponse {
|
|
1151
|
+
provider: string;
|
|
1152
|
+
user_id: string;
|
|
1153
|
+
oauth_attach_token: string;
|
|
1154
|
+
}
|
|
1155
|
+
interface DetachOAuthTokenRequest {
|
|
1156
|
+
publishableKey: string;
|
|
1157
|
+
accessToken: string;
|
|
1158
|
+
idpUserId: string;
|
|
1159
|
+
}
|
|
1160
|
+
interface WalletRegistrationNonceRequest {
|
|
1161
|
+
publishableKey: string;
|
|
1162
|
+
walletType: string;
|
|
1163
|
+
publicAddress: string;
|
|
1164
|
+
walletClientType: string;
|
|
1165
|
+
}
|
|
1166
|
+
interface WalletRegistrationNonceResponse {
|
|
1167
|
+
id: string;
|
|
1168
|
+
userId: string;
|
|
1169
|
+
nonce: string;
|
|
1170
|
+
userCreated: boolean;
|
|
1171
|
+
}
|
|
1172
|
+
interface VerifySiweWalletRegistrationRequest {
|
|
1173
|
+
publishableKey: string;
|
|
1174
|
+
walletType: string;
|
|
1175
|
+
walletClientType: string;
|
|
1176
|
+
publicAddress: string;
|
|
1177
|
+
signature: string;
|
|
1178
|
+
siweChallenge: string;
|
|
1179
|
+
sessionExpiresIn: number;
|
|
1180
|
+
accessToken?: string;
|
|
1181
|
+
}
|
|
1182
|
+
interface WalletVerifyRequest {
|
|
1183
|
+
publishableKey: string;
|
|
1184
|
+
walletType: string;
|
|
1185
|
+
publicAddress: string;
|
|
1186
|
+
signature: string;
|
|
1187
|
+
sessionExpiresIn: number;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
export { type AccessTokenClaims, type AppConfigRequest, type AppConfigResponse, type AttachOAuthTokenRequest, type AttachOAuthTokenResponse, type AuthAppearance, type AuthFlow, type AuthFlowComponent, type AuthLoginMethod, type AuthProviderConfig, type BaseGetBalanceParams, type BaseGetBalanceResult, type BaseGetTokenAccountsParams, type BaseSendTransactionParams, type BaseSendTransactionResult, type BaseSignMessageParams, type BaseSignMessageResult, type BaseSignTransactionParams, type BaseSignTransactionResult, type BaseTokenClaims, type BaseUIOptions, type BaseWalletHooks, Chain, ChainLikeWithId, type ContractUIOptions, type CreateWalletResponse, type DefaultFundingMethod, type DeleteSessionRequest, type DeleteSessionResponse, type DetachOAuthTokenRequest, type DeviceFingerprint, type DisplayMode, type EmailOtpConfig, type EmailOtpFlowState, type EthereumFundingConfig, type EthereumGetBalanceParams, type EthereumGetBalanceResult, type EthereumGetTokenAccountsByOwnerParams, type EthereumGetTokenAccountsByOwnerResult, type EthereumSendTransactionParams, type EthereumSendTransactionRequest, type EthereumSendTransactionResult, type EthereumSign7702AuthorizationParams, type EthereumSign7702AuthorizationResult, type EthereumSignHashParams, type EthereumSignHashResult, type EthereumSignMessageParams, type EthereumSignMessageResult, type EthereumSignTransactionParams, type EthereumSignTransactionResult, type EthereumSignTypedDataParams, type EthereumSignTypedDataResult, type EthereumSwitchChainParams, type ExportKeyConfig, type Factor, type FlexibleTheme, type FundWalletConfig, type FundingEvents, type FundingMethod, type FundingUIConfig, type GetCurrentSessionRequest, type GetCurrentSessionResponse, type Hex, type IdentityTokenClaims, type IdpProvider, type IsAuthenticatedRequest, type IsAuthenticatedResponse, type LoginTokenBundle, type LogoutRequest, type LogoutResponse, type MessageTypeProperty, type MessageTypes, type MoonKeyThemeConfig, type MoonPaySignRequest, type MoonPaySignResponse, type MpcKeyShares, Network, type OAuthRequest, type OAuthResponse, type OnrampFundingSettings, type PasskeyEnrollConfig, type PasskeySettings, type PreferredCardProvider, type PrefillConfig, type PublicEthereumWallet, type PublicSessionData, type PublicWallet, type RefreshSessionRequest, type RefreshSessionResponse, type RetrieveWalletKeyRequest, type RetrieveWalletKeyResponse, type SdkSettings, type SendEmailOtpRequest, type SendEmailOtpResponse, type SendTransactionConfig, type SendTransactionRequest, type SessionData, type SharesDeviceRequest, type SharesDeviceResponse, type Sign7702AuthorizationError, type Sign7702AuthorizationParams, type Sign7702AuthorizationResponse, type Sign7702AuthorizationResult, type SignMessageConfig, type SignTransactionConfig, type SignTypedDataError, type SignTypedDataParams, type SignTypedDataResponse, type SignTypedDataResult, type SmsSettings, type SolanaChain, type SolanaFundingConfig, type SolanaGetBalanceParams, type SolanaGetBalanceResult, type SolanaGetTokenAccountsByOwnerParams, type SolanaGetTokenAccountsByOwnerResult, type SolanaSendTransactionParams, type SolanaSendTransactionResult, type SolanaSignMessageParams, type SolanaSignMessageResult, type SolanaSignTransactionParams, type SolanaSignTransactionResult, type TransactionCommitment, type TransactionEncoding, type TransactionUIOptions, type TypedMessage, type UseFundWalletInterface, type UsersMePublicResponse, type UsersMeRequest, type UsersMeResponse, type VerifiedSession, type VerifyEmailOtpRequest, type VerifyEmailOtpResponse, type VerifyEmailOtpUser, type VerifyOAuthTokenRequest, type VerifyOAuthTokenResponse, type VerifySiweWalletRegistrationRequest, WALLET_ERROR_CODES, type Wallet, type WalletChain, type WalletChainType, type WalletConnectConfig, WalletCreationError, type WalletError, type WalletErrorCode, type WalletKeyRequest, type WalletListEntry, type WalletRegistrationNonceRequest, type WalletRegistrationNonceResponse, type WalletType, type WalletVerifyRequest };
|