@moon-x/core 0.10.1 → 0.12.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.
@@ -0,0 +1,6 @@
1
+ // src/utils/theme-param.ts
2
+ var FONT_URLS_KEY = "__moonxFontUrls";
3
+
4
+ export {
5
+ FONT_URLS_KEY
6
+ };
@@ -6,7 +6,7 @@ var useMoonKeySDK = () => {
6
6
  const sdk = useContext(SDKContext);
7
7
  if (!sdk) {
8
8
  throw new Error(
9
- "MoonKey hook called outside a <MoonKeyProvider> \u2014 wrap your app in the provider from @moon-x/react-sdk (web) or @moon-x/react-native-sdk (RN)."
9
+ "MoonKey hook called outside a <MoonXProvider> \u2014 wrap your app in the provider from @moon-x/react-sdk (web) or @moon-x/react-native-sdk (RN)."
10
10
  );
11
11
  }
12
12
  return sdk;
@@ -276,18 +276,6 @@ function resolvePasskeyMetadata(input) {
276
276
 
277
277
  // src/lib/ethereum/chains.ts
278
278
  import { formatEther, parseEther } from "viem";
279
- function setChainRpcUrl(chain, rpcUrl) {
280
- return {
281
- ...chain,
282
- rpcUrls: {
283
- ...chain.rpcUrls,
284
- default: {
285
- http: [rpcUrl],
286
- webSocket: chain.rpcUrls.default.webSocket
287
- }
288
- }
289
- };
290
- }
291
279
  function getRpcUrl(chain) {
292
280
  return chain.rpcUrls.default.http[0];
293
281
  }
@@ -420,35 +408,152 @@ async function estimateEvmGasReserve(rpcUrl, chainId, opts = {}) {
420
408
  return Number(formatEther(reserveWei));
421
409
  }
422
410
  function getChainById(chains, chainId) {
423
- return chains.find((chain) => chain.id === chainId);
411
+ for (const item of chains) {
412
+ const entry = normalizeChainItem(item);
413
+ if (isEvmEntry(entry) && entry.chain.id === chainId) return entry.chain;
414
+ }
415
+ return void 0;
424
416
  }
425
417
  function isChainSupported(chains, chainId) {
426
- return chains.some((chain) => chain.id === chainId);
418
+ return getChainById(chains, chainId) !== void 0;
427
419
  }
428
- function validateChainConfig(config) {
429
- const { defaultChain, supportedChains } = config;
430
- if (supportedChains && supportedChains.length === 0) {
431
- throw new Error("supportedChains cannot be an empty array");
420
+ function isEvmEntry(entry) {
421
+ return "chain" in entry;
422
+ }
423
+ function normalizeChainItem(item) {
424
+ if ("chain" in item) return item;
425
+ if (typeof item.id === "number") {
426
+ return { chain: item };
432
427
  }
433
- if (defaultChain && supportedChains) {
434
- const isDefaultInSupported = supportedChains.some(
435
- (chain) => chain.id === defaultChain.id
436
- );
437
- if (!isDefaultInSupported) {
428
+ return item;
429
+ }
430
+ function entryCaip2(entry) {
431
+ return isEvmEntry(entry) ? `eip155:${entry.chain.id}` : entry.id;
432
+ }
433
+ function slug(s) {
434
+ return s.toLowerCase().replace(/[^a-z0-9]/g, "");
435
+ }
436
+ function aliasesFor(entry) {
437
+ const keys = [];
438
+ if (isEvmEntry(entry)) {
439
+ const { chain } = entry;
440
+ keys.push(`eip155:${chain.id}`, String(chain.id));
441
+ if (chain.name) {
442
+ const s = slug(chain.name);
443
+ keys.push(`eth:${s}`, s);
444
+ }
445
+ if (chain.network) {
446
+ const s = slug(chain.network);
447
+ keys.push(`eth:${s}`, s);
448
+ }
449
+ } else {
450
+ keys.push(entry.id);
451
+ const cluster = entry.id.split(":")[1];
452
+ if (cluster) keys.push(`solana:${cluster}`, `sol:${cluster}`, cluster);
453
+ }
454
+ return keys;
455
+ }
456
+ function normalizeChainKey(key) {
457
+ if (typeof key === "number") return `eip155:${key}`;
458
+ if (typeof key === "string") return key.trim().toLowerCase();
459
+ const id = key?.id;
460
+ throw new Error(
461
+ typeof id === "number" ? `Invalid chain reference: expected an alias, CAIP-2 id, or numeric chainId, but got a chain object. Use "eip155:${id}" or ${id}.` : `Invalid chain reference: expected a string alias / CAIP-2 id or a numeric chainId, got ${typeof key}.`
462
+ );
463
+ }
464
+ function buildChainIndex(chains = []) {
465
+ const entries = chains.map(normalizeChainItem);
466
+ const byAlias = /* @__PURE__ */ new Map();
467
+ for (const entry of entries) {
468
+ for (const alias of aliasesFor(entry)) {
469
+ const key = alias.toLowerCase();
470
+ if (!byAlias.has(key)) byAlias.set(key, entry);
471
+ }
472
+ }
473
+ return { entries, byAlias };
474
+ }
475
+ function resolveChainEntry(chains, selector, defaultSelector) {
476
+ const index = buildChainIndex(chains ?? []);
477
+ if (selector != null) {
478
+ return index.byAlias.get(normalizeChainKey(selector));
479
+ }
480
+ if (defaultSelector != null) {
481
+ const fallback = index.byAlias.get(normalizeChainKey(defaultSelector));
482
+ if (fallback) return fallback;
483
+ }
484
+ return index.entries[0];
485
+ }
486
+ function resolveSolanaChainEntry(chains, selector, defaultSelector) {
487
+ const index = buildChainIndex(chains ?? []);
488
+ const asSolana = (k) => {
489
+ if (k == null) return void 0;
490
+ const e = index.byAlias.get(normalizeChainKey(k));
491
+ return e && !isEvmEntry(e) ? e : void 0;
492
+ };
493
+ if (selector != null) return asSolana(selector);
494
+ return asSolana(defaultSelector) ?? index.entries.find((e) => !isEvmEntry(e));
495
+ }
496
+ function resolveEvmChainEntry(opts) {
497
+ const index = buildChainIndex(opts.chains ?? []);
498
+ const lookup = (k) => {
499
+ if (k == null) return void 0;
500
+ const e = index.byAlias.get(normalizeChainKey(k));
501
+ return e && isEvmEntry(e) ? e : void 0;
502
+ };
503
+ if (opts.selector != null) return lookup(opts.selector);
504
+ if (opts.requestedChainId != null) return lookup(opts.requestedChainId);
505
+ return lookup(opts.walletChainId) ?? lookup(opts.defaultSelector) ?? index.entries.find(isEvmEntry);
506
+ }
507
+ function resolveRpcUrl(entry, override) {
508
+ if (override) return override;
509
+ if (isEvmEntry(entry)) return entry.rpcUrl ?? getRpcUrl(entry.chain);
510
+ return entry.rpcUrl;
511
+ }
512
+ function resolveWsUrl(entry, override) {
513
+ if (override) return override;
514
+ if (isEvmEntry(entry)) {
515
+ return entry.wsUrl ?? entry.chain.rpcUrls.default.webSocket?.[0];
516
+ }
517
+ return entry.wsUrl;
518
+ }
519
+ function validateChainConfig(config) {
520
+ const { chains, defaultChain } = config;
521
+ if (defaultChain != null) {
522
+ if (typeof defaultChain !== "string" && typeof defaultChain !== "number") {
523
+ const id = defaultChain.id;
524
+ throw new Error(
525
+ `defaultChain must be a chain reference (alias, CAIP-2 id, or numeric chainId), not a chain object.${typeof id === "number" ? ` Use "eip155:${id}" or ${id}.` : ""}`
526
+ );
527
+ }
528
+ if (!chains || chains.length === 0) {
438
529
  throw new Error(
439
- `defaultChain (${defaultChain.name}, ID: ${defaultChain.id}) must be included in supportedChains`
530
+ `defaultChain "${defaultChain}" is set but no \`chains\` are configured. Add the chain to \`chains\`, or remove \`defaultChain\`.`
440
531
  );
441
532
  }
442
533
  }
443
- }
444
- function getDefaultChain(config) {
445
- if (config.defaultChain) {
446
- return config.defaultChain;
534
+ if (!chains) return;
535
+ if (chains.length === 0) {
536
+ throw new Error("chains cannot be an empty array");
447
537
  }
448
- if (config.supportedChains && config.supportedChains.length > 0) {
449
- return config.supportedChains[0];
538
+ const index = buildChainIndex(chains);
539
+ const seen = /* @__PURE__ */ new Set();
540
+ for (const entry of index.entries) {
541
+ const id = entryCaip2(entry);
542
+ if (seen.has(id)) {
543
+ throw new Error(`Duplicate chain in config: ${id}`);
544
+ }
545
+ seen.add(id);
546
+ if (!isEvmEntry(entry) && !entry.rpcUrl) {
547
+ throw new Error(`Solana chain "${entry.id}" is missing an rpcUrl`);
548
+ }
549
+ }
550
+ if (defaultChain != null && !index.byAlias.get(normalizeChainKey(defaultChain))) {
551
+ throw new Error(
552
+ `defaultChain "${defaultChain}" is not in the configured chains (${[
553
+ ...seen
554
+ ].join(", ")})`
555
+ );
450
556
  }
451
- return void 0;
452
557
  }
453
558
 
454
559
  // src/lib/ethereum/siwe.ts
@@ -529,54 +634,91 @@ ${fields.join("\n")}`;
529
634
 
530
635
  // src/lib/ethereum/tx-prep.ts
531
636
  import { parseEther as parseEther2, parseGwei, serializeTransaction } from "viem";
637
+ function syntheticChain(chainId, rpcUrl) {
638
+ return {
639
+ id: chainId,
640
+ name: `chain-${chainId}`,
641
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
642
+ rpcUrls: { default: { http: [rpcUrl] } }
643
+ };
644
+ }
532
645
  function resolveEvmChain({
646
+ chains,
647
+ chainSelector,
533
648
  requestedChainId,
534
649
  walletChainId,
535
- supportedChains,
536
650
  defaultChain,
651
+ rpcUrlOverride,
537
652
  strict = false
538
653
  }) {
539
- let target;
540
- if (requestedChainId && supportedChains) {
541
- target = getChainById(supportedChains, Number(requestedChainId));
542
- }
543
- if (!target && walletChainId && supportedChains) {
544
- target = getChainById(supportedChains, walletChainId);
654
+ if (chainSelector != null) {
655
+ const entry2 = resolveEvmChainEntry({ chains, selector: chainSelector });
656
+ if (!entry2) {
657
+ throw new Error(
658
+ `chain "${chainSelector}" is not in the configured chains.`
659
+ );
660
+ }
661
+ return { chain: entry2.chain, rpcUrl: resolveRpcUrl(entry2, rpcUrlOverride) };
545
662
  }
546
- if (!target) {
547
- target = defaultChain;
663
+ if (requestedChainId != null) {
664
+ const entry2 = resolveEvmChainEntry({ chains, requestedChainId });
665
+ if (entry2) {
666
+ return {
667
+ chain: entry2.chain,
668
+ rpcUrl: resolveRpcUrl(entry2, rpcUrlOverride)
669
+ };
670
+ }
671
+ if (rpcUrlOverride) {
672
+ return {
673
+ chain: syntheticChain(Number(requestedChainId), rpcUrlOverride),
674
+ rpcUrl: rpcUrlOverride
675
+ };
676
+ }
677
+ if (strict) {
678
+ throw new Error(
679
+ `Requested chainId ${requestedChainId} is not in the configured chains.`
680
+ );
681
+ }
548
682
  }
549
- if (!target) {
550
- throw new Error(
551
- "No chain configured. Please set ethereum.defaultChain in MoonKeyProvider config."
552
- );
683
+ const entry = resolveEvmChainEntry({
684
+ chains,
685
+ walletChainId,
686
+ defaultSelector: defaultChain
687
+ });
688
+ if (entry) {
689
+ return { chain: entry.chain, rpcUrl: resolveRpcUrl(entry, rpcUrlOverride) };
553
690
  }
554
- if (strict && requestedChainId && Number(requestedChainId) !== target.id) {
555
- throw new Error(
556
- `Requested chainId ${requestedChainId} is not in the configured supportedChains.`
557
- );
691
+ if (rpcUrlOverride && requestedChainId != null) {
692
+ return {
693
+ chain: syntheticChain(Number(requestedChainId), rpcUrlOverride),
694
+ rpcUrl: rpcUrlOverride
695
+ };
558
696
  }
559
- return target;
697
+ throw new Error(
698
+ "No chain configured. Set `chains` (and optionally `defaultChain`) in MoonXProvider config, or pass an `rpcUrl` together with the transaction's `chainId`."
699
+ );
560
700
  }
561
701
  async function prepareEvmSignTransaction({
562
702
  transaction,
563
703
  wallet,
564
- supportedChains,
565
- defaultChain
704
+ chains,
705
+ defaultChain,
706
+ chainSelector
566
707
  }) {
567
708
  if (typeof transaction === "string") {
568
709
  return { serializedTransaction: transaction, chain: void 0 };
569
710
  }
570
711
  const txObj = transaction;
571
712
  const transactionType = txObj.type ?? 2;
572
- const chain = resolveEvmChain({
713
+ const { chain } = resolveEvmChain({
714
+ chains,
715
+ chainSelector,
573
716
  requestedChainId: txObj.chainId,
574
717
  walletChainId: wallet.chainId,
575
- supportedChains,
576
718
  defaultChain,
577
719
  strict: false
578
720
  });
579
- const derivedChainId = txObj.chainId || chain.id;
721
+ const derivedChainId = chainSelector != null ? chain.id : txObj.chainId || chain.id;
580
722
  const formattedTransaction = {
581
723
  to: txObj.to,
582
724
  value: txObj.value ? typeof txObj.value === "bigint" ? txObj.value : parseEther2(txObj.value.toString()) : BigInt(0),
@@ -608,17 +750,20 @@ async function prepareEvmSignTransaction({
608
750
  async function prepareEvmSendTransaction({
609
751
  transaction,
610
752
  wallet,
611
- supportedChains,
612
- defaultChain
753
+ chains,
754
+ defaultChain,
755
+ chainSelector,
756
+ rpcUrlOverride
613
757
  }) {
614
- const chain = resolveEvmChain({
758
+ const { chain, rpcUrl } = resolveEvmChain({
759
+ chains,
760
+ chainSelector,
615
761
  requestedChainId: transaction.chainId,
616
762
  walletChainId: wallet.chainId,
617
- supportedChains,
618
763
  defaultChain,
764
+ rpcUrlOverride,
619
765
  strict: true
620
766
  });
621
- const rpcUrl = getRpcUrl(chain);
622
767
  if (!rpcUrl) {
623
768
  throw new Error(
624
769
  `No RPC URL found for chain ${chain.name}. Chain may be missing rpcUrls configuration.`
@@ -1479,7 +1624,6 @@ export {
1479
1624
  generatePasskeyUserId,
1480
1625
  formatPasskeyLabel,
1481
1626
  resolvePasskeyMetadata,
1482
- setChainRpcUrl,
1483
1627
  getRpcUrl,
1484
1628
  getEvmMaxPriorityFeePerGas,
1485
1629
  getEvmGasPrice,
@@ -1488,8 +1632,17 @@ export {
1488
1632
  estimateEvmGasReserve,
1489
1633
  getChainById,
1490
1634
  isChainSupported,
1635
+ isEvmEntry,
1636
+ normalizeChainItem,
1637
+ entryCaip2,
1638
+ normalizeChainKey,
1639
+ buildChainIndex,
1640
+ resolveChainEntry,
1641
+ resolveSolanaChainEntry,
1642
+ resolveEvmChainEntry,
1643
+ resolveRpcUrl,
1644
+ resolveWsUrl,
1491
1645
  validateChainConfig,
1492
- getDefaultChain,
1493
1646
  EthereumSiweMessage,
1494
1647
  createManualSiweMessage,
1495
1648
  resolveEvmChain,
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- export { AccessTokenClaims, AppConfigRequest, AppConfigResponse, AttachOAuthTokenRequest, AttachOAuthTokenResponse, AuthAppearance, AuthFlow, AuthFlowComponent, AuthLoginMethod, AuthProviderConfig, BaseGetBalanceParams, BaseGetBalanceResult, BaseGetTokenAccountsParams, BaseSendTransactionParams, BaseSendTransactionResult, BaseSignMessageParams, BaseSignMessageResult, BaseSignTransactionParams, BaseSignTransactionResult, BaseTokenClaims, BaseUIOptions, BaseWalletHooks, BlockExplorer, Chain, ChainLikeWithId, ContractUIOptions, CreateWalletResponse, DefaultFundingMethod, DeleteSessionRequest, DeleteSessionResponse, DetachOAuthTokenRequest, DeviceFingerprint, DisplayMode, EmailOtpConfig, EmailOtpFlowState, EphemeralSigner, EphemeralSignerChain, EphemeralSignerScheme, EphemeralSignerWallet, EthereumChainConfig, EthereumFundingConfig, EthereumGetBalanceParams, EthereumGetBalanceResult, EthereumGetTokenAccountsByOwnerParams, EthereumGetTokenAccountsByOwnerResult, EthereumSendTransactionParams, EthereumSendTransactionRequest, EthereumSendTransactionResult, EthereumSign7702AuthorizationParams, EthereumSign7702AuthorizationResult, EthereumSignHashParams, EthereumSignHashResult, EthereumSignMessageParams, EthereumSignMessageResult, EthereumSignTransactionParams, EthereumSignTransactionResult, EthereumSignTypedDataParams, EthereumSignTypedDataResult, EthereumSwitchChainParams, ExportKeyConfig, Factor, FlexibleTheme, FundWalletConfig, FundingEvents, FundingMethod, FundingUIConfig, GetCurrentSessionRequest, GetCurrentSessionResponse, Hex, IdentityTokenClaims, IdpProvider, IsAuthenticatedRequest, IsAuthenticatedResponse, ListEphemeralSignersResult, LoginTokenBundle, LogoutRequest, LogoutResponse, MessageTypeProperty, MessageTypes, MoonKeyThemeConfig, MoonPaySignRequest, MoonPaySignResponse, MpcKeyShares, NativeCurrency, Network, OAuthRequest, OAuthResponse, OnrampFundingSettings, PasskeyEnrollConfig, PasskeySettings, PreferredCardProvider, PrefillConfig, PresenceTokenClaims, ProvisionEphemeralSignerParams, ProvisionEphemeralSignerResult, PublicEthereumWallet, PublicSessionData, PublicWallet, RefreshSessionRequest, RefreshSessionResponse, RetrieveWalletKeyRequest, RetrieveWalletKeyResponse, RevokeEphemeralSignerParams, RpcConfig, RpcUrls, SdkSettings, SendEmailOtpRequest, SendEmailOtpResponse, SendTransactionConfig, SendTransactionRequest, SessionData, SessionWallet, SharesDeviceRequest, SharesDeviceResponse, Sign7702AuthorizationError, Sign7702AuthorizationParams, Sign7702AuthorizationResponse, Sign7702AuthorizationResult, SignMessageConfig, SignTransactionConfig, SignTypedDataError, SignTypedDataParams, SignTypedDataResponse, SignTypedDataResult, SmsSettings, SolanaChain, SolanaFundingConfig, SolanaGetBalanceParams, SolanaGetBalanceResult, SolanaGetTokenAccountsByOwnerParams, SolanaGetTokenAccountsByOwnerResult, SolanaSendTransactionParams, SolanaSendTransactionResult, SolanaSignMessageParams, SolanaSignMessageResult, SolanaSignTransactionParams, SolanaSignTransactionResult, TransactionCommitment, TransactionEncoding, TransactionUIOptions, TypedMessage, UseFundWalletInterface, UsersMePublicResponse, UsersMeRequest, UsersMeResponse, VerifiedSession, VerifyEmailOtpRequest, VerifyEmailOtpResponse, VerifyEmailOtpUser, VerifyOAuthTokenRequest, VerifyOAuthTokenResponse, VerifySiweWalletRegistrationRequest, WALLET_ERROR_CODES, Wallet, WalletChain, WalletChainType, WalletConnectConfig, WalletCreationError, WalletError, WalletErrorCode, WalletKeyRequest, WalletListEntry, WalletRegistrationNonceRequest, WalletRegistrationNonceResponse, WalletType, WalletVerifyRequest } from './types/index.mjs';
2
- export { getIframeOrigin, getIframeUrl, getMoonKeyApiUrl } from './utils/index.mjs';
1
+ export { AccessTokenClaims, AppConfigRequest, AppConfigResponse, AppearanceBackdrop, AppearanceBorderRadius, AppearanceCard, AppearanceColors, AppearanceComponents, AppearanceLogo, AppearanceModeTokens, AppearanceTypography, AttachOAuthTokenRequest, AttachOAuthTokenResponse, AuthAppearance, AuthFlow, AuthFlowComponent, AuthLoginMethod, AuthProviderConfig, BaseGetBalanceParams, BaseGetBalanceResult, BaseGetTokenAccountsParams, BaseSendTransactionParams, BaseSendTransactionResult, BaseSignMessageParams, BaseSignMessageResult, BaseSignTransactionParams, BaseSignTransactionResult, BaseTokenClaims, BaseUIOptions, BaseWalletHooks, BlockExplorer, Chain, ChainConfigItem, ChainEntry, ChainLikeWithId, ComponentStyle, ContractUIOptions, CreateWalletResponse, DefaultFundingMethod, DeleteSessionRequest, DeleteSessionResponse, DetachOAuthTokenRequest, DeviceFingerprint, DisplayMode, EmailOtpConfig, EmailOtpFlowState, EphemeralSigner, EphemeralSignerChain, EphemeralSignerScheme, EphemeralSignerWallet, EthereumFundingConfig, EthereumGetBalanceParams, EthereumGetBalanceResult, EthereumGetTokenAccountsByOwnerParams, EthereumGetTokenAccountsByOwnerResult, EthereumSendTransactionParams, EthereumSendTransactionRequest, EthereumSendTransactionResult, EthereumSign7702AuthorizationParams, EthereumSign7702AuthorizationResult, EthereumSignHashParams, EthereumSignHashResult, EthereumSignMessageParams, EthereumSignMessageResult, EthereumSignTransactionParams, EthereumSignTransactionResult, EthereumSignTypedDataParams, EthereumSignTypedDataResult, EthereumSwitchChainParams, EvmChainEntry, ExportKeyConfig, Factor, FlexibleTheme, FundWalletConfig, FundingEvents, FundingMethod, FundingUIConfig, GetCurrentSessionRequest, GetCurrentSessionResponse, Hex, IdentityTokenClaims, IdpProvider, IsAuthenticatedRequest, IsAuthenticatedResponse, ListEphemeralSignersResult, LoginTokenBundle, LogoutRequest, LogoutResponse, MessageTypeProperty, MessageTypes, MoonPaySignRequest, MoonPaySignResponse, MpcKeyShares, NativeCurrency, Network, OAuthRequest, OAuthResponse, OnrampFundingSettings, PasskeyEnrollConfig, PasskeySettings, PreferredCardProvider, PrefillConfig, PresenceTokenClaims, ProvisionEphemeralSignerParams, ProvisionEphemeralSignerResult, PublicEthereumWallet, PublicSessionData, PublicWallet, RefreshSessionRequest, RefreshSessionResponse, RetrieveWalletKeyRequest, RetrieveWalletKeyResponse, RevokeEphemeralSignerParams, RpcConfig, RpcUrls, SdkSettings, SendEmailOtpRequest, SendEmailOtpResponse, SendTransactionConfig, SendTransactionRequest, SessionData, SessionWallet, SharesDeviceRequest, SharesDeviceResponse, Sign7702AuthorizationError, Sign7702AuthorizationParams, Sign7702AuthorizationResponse, Sign7702AuthorizationResult, SignMessageConfig, SignTransactionConfig, SignTypedDataError, SignTypedDataParams, SignTypedDataResponse, SignTypedDataResult, SmsSettings, SolanaChain, SolanaChainEntry, SolanaFundingConfig, SolanaGetBalanceParams, SolanaGetBalanceResult, SolanaGetTokenAccountsByOwnerParams, SolanaGetTokenAccountsByOwnerResult, SolanaSendTransactionParams, SolanaSendTransactionResult, SolanaSignMessageParams, SolanaSignMessageResult, SolanaSignTransactionParams, SolanaSignTransactionResult, TransactionCommitment, TransactionEncoding, TransactionUIOptions, TypedMessage, UseFundWalletInterface, UsersMePublicResponse, UsersMeRequest, UsersMeResponse, VerifiedSession, VerifyEmailOtpRequest, VerifyEmailOtpResponse, VerifyEmailOtpUser, VerifyOAuthTokenRequest, VerifyOAuthTokenResponse, VerifySiweWalletRegistrationRequest, WALLET_ERROR_CODES, Wallet, WalletChain, WalletChainType, WalletConnectConfig, WalletCreationError, WalletError, WalletErrorCode, WalletKeyRequest, WalletListEntry, WalletRegistrationNonceRequest, WalletRegistrationNonceResponse, WalletType, WalletVerifyRequest } from './types/index.mjs';
2
+ export { FONT_URLS_KEY, getIframeOrigin, getIframeUrl, getMoonKeyApiUrl } from './utils/index.mjs';
3
3
  export { F as FORWARDED_ERROR_FIELDS, P as PostMessageClient, a as PostMessageMethod, b as PostMessageServer, c as PostMessageType } from './post-message-BR2NClJ5.mjs';
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { AccessTokenClaims, AppConfigRequest, AppConfigResponse, AttachOAuthTokenRequest, AttachOAuthTokenResponse, AuthAppearance, AuthFlow, AuthFlowComponent, AuthLoginMethod, AuthProviderConfig, BaseGetBalanceParams, BaseGetBalanceResult, BaseGetTokenAccountsParams, BaseSendTransactionParams, BaseSendTransactionResult, BaseSignMessageParams, BaseSignMessageResult, BaseSignTransactionParams, BaseSignTransactionResult, BaseTokenClaims, BaseUIOptions, BaseWalletHooks, BlockExplorer, Chain, ChainLikeWithId, ContractUIOptions, CreateWalletResponse, DefaultFundingMethod, DeleteSessionRequest, DeleteSessionResponse, DetachOAuthTokenRequest, DeviceFingerprint, DisplayMode, EmailOtpConfig, EmailOtpFlowState, EphemeralSigner, EphemeralSignerChain, EphemeralSignerScheme, EphemeralSignerWallet, EthereumChainConfig, EthereumFundingConfig, EthereumGetBalanceParams, EthereumGetBalanceResult, EthereumGetTokenAccountsByOwnerParams, EthereumGetTokenAccountsByOwnerResult, EthereumSendTransactionParams, EthereumSendTransactionRequest, EthereumSendTransactionResult, EthereumSign7702AuthorizationParams, EthereumSign7702AuthorizationResult, EthereumSignHashParams, EthereumSignHashResult, EthereumSignMessageParams, EthereumSignMessageResult, EthereumSignTransactionParams, EthereumSignTransactionResult, EthereumSignTypedDataParams, EthereumSignTypedDataResult, EthereumSwitchChainParams, ExportKeyConfig, Factor, FlexibleTheme, FundWalletConfig, FundingEvents, FundingMethod, FundingUIConfig, GetCurrentSessionRequest, GetCurrentSessionResponse, Hex, IdentityTokenClaims, IdpProvider, IsAuthenticatedRequest, IsAuthenticatedResponse, ListEphemeralSignersResult, LoginTokenBundle, LogoutRequest, LogoutResponse, MessageTypeProperty, MessageTypes, MoonKeyThemeConfig, MoonPaySignRequest, MoonPaySignResponse, MpcKeyShares, NativeCurrency, Network, OAuthRequest, OAuthResponse, OnrampFundingSettings, PasskeyEnrollConfig, PasskeySettings, PreferredCardProvider, PrefillConfig, PresenceTokenClaims, ProvisionEphemeralSignerParams, ProvisionEphemeralSignerResult, PublicEthereumWallet, PublicSessionData, PublicWallet, RefreshSessionRequest, RefreshSessionResponse, RetrieveWalletKeyRequest, RetrieveWalletKeyResponse, RevokeEphemeralSignerParams, RpcConfig, RpcUrls, SdkSettings, SendEmailOtpRequest, SendEmailOtpResponse, SendTransactionConfig, SendTransactionRequest, SessionData, SessionWallet, SharesDeviceRequest, SharesDeviceResponse, Sign7702AuthorizationError, Sign7702AuthorizationParams, Sign7702AuthorizationResponse, Sign7702AuthorizationResult, SignMessageConfig, SignTransactionConfig, SignTypedDataError, SignTypedDataParams, SignTypedDataResponse, SignTypedDataResult, SmsSettings, SolanaChain, SolanaFundingConfig, SolanaGetBalanceParams, SolanaGetBalanceResult, SolanaGetTokenAccountsByOwnerParams, SolanaGetTokenAccountsByOwnerResult, SolanaSendTransactionParams, SolanaSendTransactionResult, SolanaSignMessageParams, SolanaSignMessageResult, SolanaSignTransactionParams, SolanaSignTransactionResult, TransactionCommitment, TransactionEncoding, TransactionUIOptions, TypedMessage, UseFundWalletInterface, UsersMePublicResponse, UsersMeRequest, UsersMeResponse, VerifiedSession, VerifyEmailOtpRequest, VerifyEmailOtpResponse, VerifyEmailOtpUser, VerifyOAuthTokenRequest, VerifyOAuthTokenResponse, VerifySiweWalletRegistrationRequest, WALLET_ERROR_CODES, Wallet, WalletChain, WalletChainType, WalletConnectConfig, WalletCreationError, WalletError, WalletErrorCode, WalletKeyRequest, WalletListEntry, WalletRegistrationNonceRequest, WalletRegistrationNonceResponse, WalletType, WalletVerifyRequest } from './types/index.js';
2
- export { getIframeOrigin, getIframeUrl, getMoonKeyApiUrl } from './utils/index.js';
1
+ export { AccessTokenClaims, AppConfigRequest, AppConfigResponse, AppearanceBackdrop, AppearanceBorderRadius, AppearanceCard, AppearanceColors, AppearanceComponents, AppearanceLogo, AppearanceModeTokens, AppearanceTypography, AttachOAuthTokenRequest, AttachOAuthTokenResponse, AuthAppearance, AuthFlow, AuthFlowComponent, AuthLoginMethod, AuthProviderConfig, BaseGetBalanceParams, BaseGetBalanceResult, BaseGetTokenAccountsParams, BaseSendTransactionParams, BaseSendTransactionResult, BaseSignMessageParams, BaseSignMessageResult, BaseSignTransactionParams, BaseSignTransactionResult, BaseTokenClaims, BaseUIOptions, BaseWalletHooks, BlockExplorer, Chain, ChainConfigItem, ChainEntry, ChainLikeWithId, ComponentStyle, ContractUIOptions, CreateWalletResponse, DefaultFundingMethod, DeleteSessionRequest, DeleteSessionResponse, DetachOAuthTokenRequest, DeviceFingerprint, DisplayMode, EmailOtpConfig, EmailOtpFlowState, EphemeralSigner, EphemeralSignerChain, EphemeralSignerScheme, EphemeralSignerWallet, EthereumFundingConfig, EthereumGetBalanceParams, EthereumGetBalanceResult, EthereumGetTokenAccountsByOwnerParams, EthereumGetTokenAccountsByOwnerResult, EthereumSendTransactionParams, EthereumSendTransactionRequest, EthereumSendTransactionResult, EthereumSign7702AuthorizationParams, EthereumSign7702AuthorizationResult, EthereumSignHashParams, EthereumSignHashResult, EthereumSignMessageParams, EthereumSignMessageResult, EthereumSignTransactionParams, EthereumSignTransactionResult, EthereumSignTypedDataParams, EthereumSignTypedDataResult, EthereumSwitchChainParams, EvmChainEntry, ExportKeyConfig, Factor, FlexibleTheme, FundWalletConfig, FundingEvents, FundingMethod, FundingUIConfig, GetCurrentSessionRequest, GetCurrentSessionResponse, Hex, IdentityTokenClaims, IdpProvider, IsAuthenticatedRequest, IsAuthenticatedResponse, ListEphemeralSignersResult, LoginTokenBundle, LogoutRequest, LogoutResponse, MessageTypeProperty, MessageTypes, MoonPaySignRequest, MoonPaySignResponse, MpcKeyShares, NativeCurrency, Network, OAuthRequest, OAuthResponse, OnrampFundingSettings, PasskeyEnrollConfig, PasskeySettings, PreferredCardProvider, PrefillConfig, PresenceTokenClaims, ProvisionEphemeralSignerParams, ProvisionEphemeralSignerResult, PublicEthereumWallet, PublicSessionData, PublicWallet, RefreshSessionRequest, RefreshSessionResponse, RetrieveWalletKeyRequest, RetrieveWalletKeyResponse, RevokeEphemeralSignerParams, RpcConfig, RpcUrls, SdkSettings, SendEmailOtpRequest, SendEmailOtpResponse, SendTransactionConfig, SendTransactionRequest, SessionData, SessionWallet, SharesDeviceRequest, SharesDeviceResponse, Sign7702AuthorizationError, Sign7702AuthorizationParams, Sign7702AuthorizationResponse, Sign7702AuthorizationResult, SignMessageConfig, SignTransactionConfig, SignTypedDataError, SignTypedDataParams, SignTypedDataResponse, SignTypedDataResult, SmsSettings, SolanaChain, SolanaChainEntry, SolanaFundingConfig, SolanaGetBalanceParams, SolanaGetBalanceResult, SolanaGetTokenAccountsByOwnerParams, SolanaGetTokenAccountsByOwnerResult, SolanaSendTransactionParams, SolanaSendTransactionResult, SolanaSignMessageParams, SolanaSignMessageResult, SolanaSignTransactionParams, SolanaSignTransactionResult, TransactionCommitment, TransactionEncoding, TransactionUIOptions, TypedMessage, UseFundWalletInterface, UsersMePublicResponse, UsersMeRequest, UsersMeResponse, VerifiedSession, VerifyEmailOtpRequest, VerifyEmailOtpResponse, VerifyEmailOtpUser, VerifyOAuthTokenRequest, VerifyOAuthTokenResponse, VerifySiweWalletRegistrationRequest, WALLET_ERROR_CODES, Wallet, WalletChain, WalletChainType, WalletConnectConfig, WalletCreationError, WalletError, WalletErrorCode, WalletKeyRequest, WalletListEntry, WalletRegistrationNonceRequest, WalletRegistrationNonceResponse, WalletType, WalletVerifyRequest } from './types/index.js';
2
+ export { FONT_URLS_KEY, getIframeOrigin, getIframeUrl, getMoonKeyApiUrl } from './utils/index.js';
3
3
  export { F as FORWARDED_ERROR_FIELDS, P as PostMessageClient, a as PostMessageMethod, b as PostMessageServer, c as PostMessageType } from './post-message-BR2NClJ5.js';
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
+ FONT_URLS_KEY: () => FONT_URLS_KEY,
23
24
  FORWARDED_ERROR_FIELDS: () => FORWARDED_ERROR_FIELDS,
24
25
  Network: () => Network,
25
26
  PostMessageClient: () => PostMessageClient,
@@ -462,8 +463,12 @@ var PostMessageServer = class {
462
463
  }
463
464
  }
464
465
  };
466
+
467
+ // src/utils/theme-param.ts
468
+ var FONT_URLS_KEY = "__moonxFontUrls";
465
469
  // Annotate the CommonJS export names for ESM import in node:
466
470
  0 && (module.exports = {
471
+ FONT_URLS_KEY,
467
472
  FORWARDED_ERROR_FIELDS,
468
473
  Network,
469
474
  PostMessageClient,
package/dist/index.mjs CHANGED
@@ -3,7 +3,9 @@ import {
3
3
  WALLET_ERROR_CODES,
4
4
  WalletCreationError
5
5
  } from "./chunk-IMLBIIJ4.mjs";
6
- import "./chunk-CMYR6AOY.mjs";
6
+ import {
7
+ FONT_URLS_KEY
8
+ } from "./chunk-527SU2F6.mjs";
7
9
  import {
8
10
  getIframeOrigin,
9
11
  getIframeUrl
@@ -19,6 +21,7 @@ import {
19
21
  getMoonKeyApiUrl
20
22
  } from "./chunk-GQKIA37O.mjs";
21
23
  export {
24
+ FONT_URLS_KEY,
22
25
  FORWARDED_ERROR_FIELDS,
23
26
  Network,
24
27
  PostMessageClient,