@bluxcc/core 0.3.0 → 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.
- package/README.md +122 -70
- package/dist/assets/AdditionalSocialLogos.d.ts +15 -0
- package/dist/assets/AppleLogo.d.ts +3 -0
- package/dist/assets/DiscordLogo.d.ts +1 -0
- package/dist/assets/GitHubLogo.d.ts +3 -0
- package/dist/assets/MetaLogo.d.ts +1 -0
- package/dist/assets/TelegramLogo.d.ts +1 -0
- package/dist/assets/index.d.ts +13 -0
- package/dist/components/CardItem/index.d.ts +3 -2
- package/dist/components/CardItem/variants/input.d.ts +3 -2
- package/dist/components/SocialProviderIcon.d.ts +5 -0
- package/dist/enums.d.ts +2 -1
- package/dist/exports/core/helpers/account.d.ts +0 -8
- package/dist/exports/core/swap.d.ts +9 -0
- package/dist/exports/createConfig.d.ts +1 -1
- package/dist/exports/index.d.ts +1 -0
- package/dist/hooks/useTransactions.d.ts +5 -0
- package/dist/index.cjs.js +10 -10
- package/dist/index.esm.js +14 -14
- package/dist/pages/Onboarding/Socials/OtherSocials.d.ts +2 -0
- package/dist/pages/Onboarding/Socials/SocialLoginButton.d.ts +7 -0
- package/dist/pages/Onboarding/Socials/TelegramWidget.d.ts +6 -0
- package/dist/stellar/getTransactionDetails.d.ts +1 -1
- package/dist/stellar/moneygram.d.ts +26 -0
- package/dist/stellar/paymentTransaction.d.ts +3 -3
- package/dist/store.d.ts +4 -4
- package/dist/types.d.ts +14 -4
- package/dist/utils/api.d.ts +2 -1
- package/dist/utils/helpers.d.ts +2 -2
- package/dist/utils/networkRpc.d.ts +7 -0
- package/dist/utils/socialLogin.d.ts +11 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,27 +6,27 @@ Blux Core is a JavaScript/TypeScript SDK for adding authentication, Stellar wall
|
|
|
6
6
|
|
|
7
7
|
## Useful Links
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
- **Website:** [blux.cc](https://blux.cc/)
|
|
10
|
+
- **Documentation:** [docs.blux.cc](https://docs.blux.cc/)
|
|
11
|
+
- **Live Demo:** [demo.blux.cc](https://demo.blux.cc/)
|
|
12
|
+
- **Dashboard:** [dashboard.blux.cc](https://dashboard.blux.cc/)
|
|
13
13
|
|
|
14
14
|
## Features
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
- **Framework-Agnostic**: Use Blux Core with vanilla JavaScript, TypeScript, or any frontend framework.
|
|
17
|
+
- **Multi-Wallet Support**: Integrate Stellar wallets such as **Rabet, xBull, LOBSTR, Freighter, Albedo, HOT Wallet, Hana, and more**.
|
|
18
|
+
- **Email, Passkey & Social Authentication**: Onboard users without requiring them to install or manage a traditional wallet.
|
|
19
|
+
- **Transaction Signing**: Connect wallets and request transaction signatures through a consistent interface.
|
|
20
|
+
- **Soroban Support**: Add Stellar smart contract interactions to your application.
|
|
21
|
+
- **Customizable UI**: Adjust themes, fonts, backgrounds, logos, border radius, text colors, and other interface elements.
|
|
22
|
+
- **Wallet Configuration**: Include or exclude individual wallets and control their display order.
|
|
23
|
+
- **Configurable Networks**: Choose the Stellar networks supported by your application and set a default network.
|
|
24
|
+
- **Custom Explorer**: Configure the block explorer used for account and transaction links.
|
|
25
|
+
- **Localization**: Provide the authentication experience in multiple supported languages.
|
|
26
|
+
- **User Management & Analytics**: Review authentication methods, login activity, timestamps, and associated wallet addresses through the Blux dashboard.
|
|
27
|
+
- **Testing Tools**: Use predefined test accounts and reusable OTP credentials in configured testing environments.
|
|
28
|
+
- **Multiple Projects**: Create and manage multiple applications from a single Blux account.
|
|
29
|
+
- **Future-Proof**: More wallets and authentication methods will be added based on community feedback.
|
|
30
30
|
|
|
31
31
|
## Installation
|
|
32
32
|
|
|
@@ -77,24 +77,73 @@ document.getElementById('loginBtn').onclick = async () => {
|
|
|
77
77
|
|
|
78
78
|
Create a project through the [Blux Dashboard](https://dashboard.blux.cc/) to obtain your application ID. You can create and manage multiple projects from the same account.
|
|
79
79
|
|
|
80
|
+
### Social Login
|
|
81
|
+
|
|
82
|
+
Add any supported provider to `loginMethods`. The first enabled social is
|
|
83
|
+
shown on the login screen; the rest appear on **Other socials**.
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
createConfig({
|
|
87
|
+
appName: 'My App',
|
|
88
|
+
appId: 'GET_FROM_BLUX_DASHBOARD',
|
|
89
|
+
networks: [core.networks.mainnet],
|
|
90
|
+
loginMethods: [
|
|
91
|
+
'wallet',
|
|
92
|
+
'google',
|
|
93
|
+
'apple',
|
|
94
|
+
'discord',
|
|
95
|
+
'telegram',
|
|
96
|
+
'meta',
|
|
97
|
+
'github',
|
|
98
|
+
'farcaster',
|
|
99
|
+
'tiktok',
|
|
100
|
+
'linkedin',
|
|
101
|
+
'twitch',
|
|
102
|
+
'kick',
|
|
103
|
+
'spotify',
|
|
104
|
+
'instagram',
|
|
105
|
+
'microsoft',
|
|
106
|
+
'gitlab',
|
|
107
|
+
'twitter',
|
|
108
|
+
'steam',
|
|
109
|
+
'email',
|
|
110
|
+
'passkey',
|
|
111
|
+
],
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Each provider is shown only when requested in `loginMethods` and returned in
|
|
116
|
+
the app's enabled `socials` by `/auth/validate`. Most providers open
|
|
117
|
+
`/auth/social/{provider}/start` on the Blux API (for example,
|
|
118
|
+
`/auth/social/meta/start` or `/auth/social/github/start`) and use the
|
|
119
|
+
shared social-login success, retry, and cancellation flow. Telegram uses
|
|
120
|
+
the on-page [Login Widget](https://core.telegram.org/widgets/login) instead
|
|
121
|
+
of a popup, because the bot is bound to the site's domain; Mini Apps can
|
|
122
|
+
complete login via WebApp init data when that is enabled for the project.
|
|
123
|
+
|
|
124
|
+
The backend must support each provider and have the project's credentials
|
|
125
|
+
and callbacks configured. Private keys, client secrets, and bot tokens never
|
|
126
|
+
belong in this browser configuration. Token verification is the backend's
|
|
127
|
+
responsibility; the SDK accepts only the resulting Blux session.
|
|
128
|
+
|
|
80
129
|
## Customization
|
|
81
130
|
|
|
82
131
|
Developers can customize various UI elements:
|
|
83
132
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
133
|
+
- **Themes & Fonts**
|
|
134
|
+
- **Backgrounds, Logos**
|
|
135
|
+
- **Border Radius & Text Colors**
|
|
136
|
+
- **Authentication Limits** (Free tier supports 500-1000 accounts per auth method)
|
|
88
137
|
|
|
89
138
|
Developers can also configure:
|
|
90
139
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
140
|
+
- Enabled authentication methods
|
|
141
|
+
- Included and excluded wallets
|
|
142
|
+
- Wallet display order
|
|
143
|
+
- Supported networks
|
|
144
|
+
- Default network
|
|
145
|
+
- Block explorer
|
|
146
|
+
- Interface language
|
|
98
147
|
|
|
99
148
|
Configuration options can be set via the `BluxProvider` config or environment variables.
|
|
100
149
|
|
|
@@ -104,11 +153,11 @@ The Blux dashboard provides information about the users who have connected to yo
|
|
|
104
153
|
|
|
105
154
|
Available information includes:
|
|
106
155
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
156
|
+
- Authentication method
|
|
157
|
+
- Login and connection timestamps
|
|
158
|
+
- Associated wallet addresses, when available
|
|
159
|
+
- Recent authentication activity
|
|
160
|
+
- Individual user information
|
|
112
161
|
|
|
113
162
|
This information can help developers understand how their applications are being used and troubleshoot authentication or wallet connection issues.
|
|
114
163
|
|
|
@@ -124,57 +173,60 @@ These credentials are intended only for the configured testing environment. Refe
|
|
|
124
173
|
|
|
125
174
|
Currently supported connection methods:
|
|
126
175
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
176
|
+
- [x] **Freighter**
|
|
177
|
+
- [x] **Rabet**
|
|
178
|
+
- [x] **WalletConnect**
|
|
179
|
+
- [x] **HOT Wallet**
|
|
180
|
+
- [x] **Hana**
|
|
181
|
+
- [x] **xBull**
|
|
182
|
+
- [x] **LOBSTR**
|
|
183
|
+
- [x] **Ledger**
|
|
184
|
+
- [x] **Albedo**
|
|
185
|
+
- [x] **Klever Wallet**
|
|
186
|
+
- [x] **Bitget Wallet**
|
|
187
|
+
- [x] **OneKey**
|
|
188
|
+
- [x] **CactusLink**
|
|
189
|
+
- [x] **Fordefi**
|
|
190
|
+
- [x] **Trezor**
|
|
191
|
+
- [x] **Email**
|
|
192
|
+
- [x] **Google**
|
|
193
|
+
- [x] **Apple**
|
|
194
|
+
- [x] **Discord**
|
|
195
|
+
- [x] **Telegram**
|
|
196
|
+
- [x] **Passkey**
|
|
145
197
|
|
|
146
198
|
## Supported Languages
|
|
147
199
|
|
|
148
200
|
Currently supported languages:
|
|
149
201
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
202
|
+
- [x] **English**
|
|
203
|
+
- [x] **Spanish**
|
|
204
|
+
- [x] **Portuguese**
|
|
205
|
+
- [x] **French**
|
|
206
|
+
- [x] **German**
|
|
207
|
+
- [x] **Russian**
|
|
208
|
+
- [x] **Chinese**
|
|
209
|
+
- [x] **Japanese**
|
|
210
|
+
- [x] **Korean**
|
|
159
211
|
|
|
160
212
|
## License & Usage Restrictions
|
|
161
213
|
|
|
162
|
-
|
|
163
|
-
|
|
214
|
+
- **No Forking or Unauthorized Modifications**: Removing references to **Blux Team** or forking without attribution is strictly prohibited.
|
|
215
|
+
- **Custom Licensing Available**: Contact us at [support@blux.cc](mailto:support@blux.cc) to discuss licensing options.
|
|
164
216
|
|
|
165
217
|
## Support & Contact
|
|
166
218
|
|
|
167
219
|
For support, licensing, custom SMS authentication, or other inquiries, reach out via:
|
|
168
220
|
|
|
169
|
-
|
|
170
|
-
|
|
221
|
+
- **Email**: [support@blux.cc](mailto:support@blux.cc)
|
|
222
|
+
- **X**: [@BluxOfficial](https://x.com/bluxofficial)
|
|
171
223
|
|
|
172
224
|
## Roadmap & Future Plans
|
|
173
225
|
|
|
174
226
|
Blux is evolving. Follow our updates on [X](https://x.com/BluxOfficial) for:
|
|
175
227
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
228
|
+
- **Additional OAuth and Social Authentication Methods**
|
|
229
|
+
- **More Wallet Integrations**
|
|
230
|
+
- **Enhanced Developer Hooks**
|
|
231
|
+
- **Expanded Soroban Support**
|
|
232
|
+
- **Enhanced Customization, Analytics, and Security Features**
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const FarcasterLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const TikTokLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const LinkedInLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const TwitchLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const KickLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const SpotifyLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const InstagramLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const MicrosoftLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const GitLabLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const XLogo: ({ fill }: {
|
|
11
|
+
fill?: string;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const SteamLogo: ({ fill }: {
|
|
14
|
+
fill?: string;
|
|
15
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DiscordLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MetaLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TelegramLogo: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/assets/index.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export declare const CurrencyExchange: ({ fill }: {
|
|
2
|
+
fill?: string;
|
|
3
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const BuyIcon: ({ fill }: {
|
|
5
|
+
fill?: string;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const SellIcon: ({ fill }: {
|
|
8
|
+
fill?: string;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
1
10
|
export declare const ArrowOutward: ({ fill }: {
|
|
2
11
|
fill?: string;
|
|
3
12
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,5 +24,9 @@ export declare const FordefiLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
|
15
24
|
export declare const TrezorLogo: ({ fill }: {
|
|
16
25
|
fill?: string;
|
|
17
26
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const MoneyGramLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
18
28
|
export declare const MoonPayLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
19
29
|
export declare const PasskeyFingerLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare const PhoneIcon: ({ fill }: {
|
|
31
|
+
fill?: string;
|
|
32
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,7 +10,8 @@ type CardItemProps = {
|
|
|
10
10
|
onChange?: (value: string) => void;
|
|
11
11
|
onEnter?: (value: string) => void;
|
|
12
12
|
onSubmit?: (value: string) => void;
|
|
13
|
-
inputType?: 'text' | 'password' | 'number' | 'email' | string;
|
|
13
|
+
inputType?: 'text' | 'password' | 'number' | 'email' | 'tel' | string;
|
|
14
|
+
placeholder?: string;
|
|
14
15
|
};
|
|
15
|
-
declare const CardItem: ({ variant, size, startIcon, endArrow, isRecent, label, onClick, onChange, onEnter, onSubmit, inputType, }: CardItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const CardItem: ({ variant, size, startIcon, endArrow, isRecent, label, onClick, onChange, onEnter, onSubmit, inputType, placeholder, }: CardItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export default CardItem;
|
|
@@ -4,7 +4,8 @@ type InputCardProps = {
|
|
|
4
4
|
onChange?: (value: string) => void;
|
|
5
5
|
onEnter?: (value: string) => void;
|
|
6
6
|
onSubmit?: (value: string) => void;
|
|
7
|
-
inputType?: 'text' | 'password' | 'number' | 'email' | string;
|
|
7
|
+
inputType?: 'text' | 'password' | 'number' | 'email' | 'tel' | string;
|
|
8
|
+
placeholder?: string;
|
|
8
9
|
};
|
|
9
|
-
declare const InputCard: ({ startIcon, onChange, onEnter, onSubmit, inputType, }: InputCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const InputCard: ({ startIcon, onChange, onEnter, onSubmit, inputType, placeholder, }: InputCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export default InputCard;
|
package/dist/enums.d.ts
CHANGED
|
@@ -26,7 +26,8 @@ export declare enum StellarNetwork {
|
|
|
26
26
|
export declare enum Route {
|
|
27
27
|
ONBOARDING = "ONBOARDING",// View for selecting a wallet
|
|
28
28
|
PASSKEY_ONBOARDING = "PASSKEY_ONBOARDING",
|
|
29
|
-
SOCIALS_ONBOARDING = "SOCIALS_ONBOARDING",// Social
|
|
29
|
+
SOCIALS_ONBOARDING = "SOCIALS_ONBOARDING",// Social login waiting / widget / popup flow
|
|
30
|
+
OTHER_SOCIALS = "OTHER_SOCIALS",// Remaining social providers after the primary one
|
|
30
31
|
WRONG_NETWORK = "WRONG_NETWORK",// View for selecting a wallet
|
|
31
32
|
WAITING = "WAITING",// View for connection process
|
|
32
33
|
SUCCESSFUL = "SUCCESSFUL",// View for connection success process
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import { Asset, Horizon } from '@stellar/stellar-sdk';
|
|
2
|
-
/**
|
|
3
|
-
* Loads an account from Horizon, returning `null` instead of throwing when the
|
|
4
|
-
* account does not exist on the network yet.
|
|
5
|
-
*
|
|
6
|
-
* @param horizon - The Horizon server to query.
|
|
7
|
-
* @param address - The account id (`G...`) to load.
|
|
8
|
-
* @returns The account, or `null` if it is not found.
|
|
9
|
-
*/
|
|
10
2
|
export declare const loadAccount: (horizon: Horizon.Server, address: string) => Promise<Horizon.AccountResponse | null>;
|
|
11
3
|
/**
|
|
12
4
|
* Reports whether `account` can receive `asset` directly: always true for the
|
|
@@ -38,6 +38,15 @@ export type SwapOptions = {
|
|
|
38
38
|
/** Network passphrase to swap on. Defaults to the active network. */
|
|
39
39
|
network?: string;
|
|
40
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* Builds the unsigned swap transaction XDR. {@link swap} signs and submits this
|
|
43
|
+
* envelope; the profile Swap page uses it so it can close the modal before
|
|
44
|
+
* opening the signing flow.
|
|
45
|
+
*
|
|
46
|
+
* @param options - What to swap and how — see {@link SwapOptions}.
|
|
47
|
+
* @returns The unsigned transaction envelope as XDR.
|
|
48
|
+
*/
|
|
49
|
+
export declare const buildSwapTransaction: (options: SwapOptions) => Promise<string>;
|
|
41
50
|
/**
|
|
42
51
|
* Swaps one asset for another through the Stellar DEX / liquidity pools using a
|
|
43
52
|
* path payment, picking the best available path automatically. Routes of at
|
|
@@ -7,7 +7,7 @@ export type { IAppearance, IConfig, IExplorer, ILoginMethods, IServers, ITrezorM
|
|
|
7
7
|
*
|
|
8
8
|
* Wallet availability is always scanned in the background. `isReady` waits on
|
|
9
9
|
* that scan only when `loginMethods` includes `'wallet'`; apps that omit
|
|
10
|
-
* wallet login (email/social/passkey only) become ready as soon as the config
|
|
10
|
+
* wallet login (email/SMS/social/passkey only) become ready as soon as the config
|
|
11
11
|
* is applied, so they are not blocked by extension detection or `window.load`.
|
|
12
12
|
*
|
|
13
13
|
* @param config - The app configuration — see {@link IConfig}.
|
package/dist/exports/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export type { IExportedStore } from './exportedStore';
|
|
|
5
5
|
export { Asset } from '@stellar/stellar-sdk';
|
|
6
6
|
export * as StellarSdk from '@stellar/stellar-sdk';
|
|
7
7
|
export * from './core';
|
|
8
|
+
export * as core from './core';
|
|
8
9
|
export { blux } from './blux';
|
|
9
10
|
export { BluxEvent } from '../utils/events';
|
|
10
11
|
export { getState, subscribe, getInitialState, useExportedStore, } from './exportedStore';
|
|
@@ -7,5 +7,10 @@ export type UseTransactionsResult = {
|
|
|
7
7
|
error: Error | null;
|
|
8
8
|
transactions: TransactionRecordWithOperations[];
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Horizon activity for the signed-in account. Mount this only from the
|
|
12
|
+
* Activity page — listing txs and then fetching each one's operations is
|
|
13
|
+
* expensive and should not run in the background.
|
|
14
|
+
*/
|
|
10
15
|
declare const useTransactions: () => UseTransactionsResult;
|
|
11
16
|
export default useTransactions;
|