@bluxcc/core 0.3.1 → 0.3.2

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,2 @@
1
+ declare const OtherSocials: () => import("react/jsx-runtime").JSX.Element;
2
+ export default OtherSocials;
@@ -0,0 +1,7 @@
1
+ type SocialLoginButtonProps = {
2
+ provider: string;
3
+ onClick: (provider: string) => void;
4
+ nameOnly?: boolean;
5
+ };
6
+ declare const SocialLoginButton: ({ provider, onClick, nameOnly, }: SocialLoginButtonProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default SocialLoginButton;
@@ -0,0 +1,6 @@
1
+ type TelegramWidgetProps = {
2
+ botUsername: string;
3
+ onAuth: (user: Record<string, unknown>) => void;
4
+ };
5
+ declare const TelegramWidget: ({ botUsername, onAuth }: TelegramWidgetProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default TelegramWidget;
package/dist/types.d.ts CHANGED
@@ -10,7 +10,7 @@ type LooseString = string & {};
10
10
  /** Block explorer used to build account/transaction links. */
11
11
  export type IExplorer = 'steexp' | 'stellarchain' | 'stellarexpert' | 'lumenscan';
12
12
  /** Social login providers supported by Blux. */
13
- export type ISocialProvider = 'google';
13
+ export type ISocialProvider = 'google' | 'apple' | 'discord' | 'telegram' | 'meta' | 'github' | 'farcaster' | 'tiktok' | 'linkedin' | 'twitch' | 'kick' | 'spotify' | 'instagram' | 'microsoft' | 'gitlab' | 'twitter' | 'steam';
14
14
  /** Login methods to offer in the modal. */
15
15
  export type ILoginMethods = Array<'wallet' | 'sms' | 'email' | 'passkey' | ISocialProvider>;
16
16
  /** Canonical names of the wallets Blux can integrate with. */
@@ -259,6 +259,12 @@ export interface ISignAuthEntry {
259
259
  export interface ISocialConfigEntry {
260
260
  provider: string;
261
261
  displayName: string;
262
+ /** Login mechanism from /auth/validate: oauth2, steam, farcaster, or telegram. */
263
+ kind?: string;
264
+ /** Telegram bot username the on-page widget needs; empty for other providers. */
265
+ publicId?: string;
266
+ /** Telegram Mini App / in-app login is enabled for this project. */
267
+ miniApps?: boolean;
262
268
  }
263
269
  export interface AuthenticateApiResponse {
264
270
  isValid: boolean;
@@ -48,4 +48,5 @@ export type ApiGroupedTokens = {
48
48
  export declare const apiGetTokens: (JWT: string) => Promise<ApiGroupedTokens>;
49
49
  export declare const apiAddToken: (JWT: string, contractAddress: string, network: "mainnet" | "testnet") => Promise<ApiTokenView>;
50
50
  export declare const apiDeleteToken: (JWT: string, tokenId: number) => Promise<boolean>;
51
+ export declare const apiTelegramLogin: (appId: string, payload: Record<string, unknown>) => Promise<string>;
51
52
  export {};
@@ -1,12 +1,21 @@
1
+ import type { ComponentType } from 'react';
1
2
  import CDNFiles from '../constants/cdnFiles';
2
3
  import { ILoginMethods, AuthenticateApiResponse } from '../types';
3
4
  type SocialProviderMeta = {
4
5
  displayName: string;
5
- icon: CDNFiles;
6
+ icon: CDNFiles | ComponentType<{
7
+ fill?: string;
8
+ }>;
6
9
  };
7
10
  export declare const SOCIAL_PROVIDERS: Record<string, SocialProviderMeta>;
11
+ export declare const canonicalSocialName: (method: string) => string;
8
12
  export declare const isSocialProvider: (method: string) => boolean;
13
+ export declare const getSocialDisplayName: (provider: string) => string;
9
14
  export declare const getEnabledSocials: (loginMethods: ILoginMethods | string[], apiResponse?: AuthenticateApiResponse) => string[];
15
+ export declare const telegramBotUsername: (apiResponse?: AuthenticateApiResponse) => string;
16
+ export declare const telegramMiniAppsEnabled: (apiResponse?: AuthenticateApiResponse) => boolean;
17
+ export declare const telegramWebAppInitData: () => string;
18
+ export declare const isTelegramLogin: (provider: string, apiResponse?: AuthenticateApiResponse) => boolean;
10
19
  export type ISocialSession = {
11
20
  provider: string;
12
21
  popup: Window | null;
@@ -15,5 +24,6 @@ export type ISocialSession = {
15
24
  export declare const getActiveSocialSession: () => ISocialSession | null;
16
25
  export declare const cancelActiveSocialSession: () => void;
17
26
  export declare const beginSocialLogin: (provider: string, appId: string) => ISocialSession;
27
+ export declare const startSocialLogin: (provider: string, appId: string, apiResponse?: AuthenticateApiResponse) => void;
18
28
  export declare const awaitSocialLogin: (session: ISocialSession) => Promise<string>;
19
29
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluxcc/core",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "homepage": "https://blux.cc",
5
5
  "description": "Blux is a wallet infra for the Stellar network",
6
6
  "type": "module",