@bluxcc/core 0.1.3 → 0.1.5
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 +30 -75
- package/dist/assets/Icons.d.ts +9 -0
- package/dist/assets/Logos.d.ts +2 -0
- package/dist/components/AssetsList/index.d.ts +1 -1
- package/dist/components/Button/index.d.ts +7 -5
- package/dist/components/CardItem/index.d.ts +4 -4
- package/dist/components/Header/index.d.ts +1 -1
- package/dist/components/Input/index.d.ts +4 -3
- package/dist/components/Modal/index.d.ts +2 -2
- package/dist/components/TabBox/index.d.ts +1 -1
- package/dist/constants/assets.d.ts +18 -0
- package/dist/constants/locales.d.ts +1 -1
- package/dist/constants/routes.d.ts +2 -2
- package/dist/enums.d.ts +2 -1
- package/dist/exports/core/getBalances.d.ts +3 -3
- package/dist/exports/core/getPayments.d.ts +1 -1
- package/dist/exports/utils.d.ts +2 -2
- package/dist/hooks/useBalances.d.ts +1 -1
- package/dist/hooks/useCheckWalletNetwork.d.ts +3 -0
- package/dist/hooks/useDynamicHeight.d.ts +2 -1
- package/dist/hooks/useLockBodyScroll.d.ts +1 -0
- package/dist/hooks/useModalAnimation.d.ts +2 -4
- package/dist/hooks/useTransactions.d.ts +2 -2
- package/dist/index.cjs.js +11 -19
- package/dist/index.esm.js +11 -19
- package/dist/index.iife.js +15 -23
- package/dist/pages/Profile/SelectAsset/index.d.ts +2 -9
- package/dist/pages/Profile/Send/index.d.ts +2 -2
- package/dist/pages/Profile/Swap/AssetBox/index.d.ts +5 -2
- package/dist/stellar/getTransactionDetails.d.ts +1 -1
- package/dist/stellar/processes/connectWalletProcess.d.ts +2 -2
- package/dist/stellar/swapTransaction.d.ts +4 -0
- package/dist/store.d.ts +9 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/helpers.d.ts +15 -6
- package/dist/utils/initializeWalletConnect.d.ts +6 -2
- package/dist/wallets/albedo.d.ts +1 -1
- package/dist/wallets/freighter.d.ts +1 -1
- package/dist/wallets/hana.d.ts +1 -1
- package/dist/wallets/hot.d.ts +1 -1
- package/dist/wallets/klever.d.ts +1 -1
- package/dist/wallets/lobstr.d.ts +1 -1
- package/dist/wallets/rabet.d.ts +1 -1
- package/dist/wallets/xbull.d.ts +1 -1
- package/package.json +4 -4
- package/dist/components/Modal/Backdrop/index.d.ts +0 -7
- package/dist/pages/Profile/Send/SendForm.d.ts +0 -2
package/README.md
CHANGED
|
@@ -1,93 +1,57 @@
|
|
|
1
1
|
# Blux Wallet Kit - The Missing Piece for Stellar dApps
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Blux is a **comprehensive authentication and wallet connect kit** designed for Stellar dApps.
|
|
6
|
+
It simplifies onboarding by integrating multiple authentication methods, including **wallets, email, passkey, and socials**.
|
|
4
7
|
|
|
5
8
|
## Features
|
|
6
9
|
|
|
7
|
-
- **Multi-Wallet Support**: Easily integrate Stellar wallets such as **Rabet, xBull, Lobstr, Freighter, and
|
|
8
|
-
- **
|
|
9
|
-
- **Email &
|
|
10
|
+
- **Multi-Wallet Support**: Easily integrate Stellar wallets such as **Rabet, xBull, Lobstr, Freighter, Albedo, Hot Wallet, Hana Wallet, and more**.
|
|
11
|
+
- **Social Login** _(Coming Soon)_: Support for **Apple, Meta, Google, and more**.
|
|
12
|
+
- **Email & Passkey** _(Coming Soon)_: Securely onboard users with non-crypto credentials.
|
|
10
13
|
- **Customizable UI**: Adjust themes, fonts, backgrounds, logos, border radius, and text colors.
|
|
11
14
|
- **Configurable Networks**: Set up and modify network preferences via API keys.
|
|
12
15
|
- **Future-Proof**: More wallets and authentication methods will be added based on community feedback.
|
|
13
16
|
|
|
14
17
|
## Installation
|
|
15
18
|
|
|
16
|
-
Blux can be installed via npm:
|
|
17
|
-
|
|
18
19
|
```sh
|
|
19
20
|
npm i @bluxcc/core
|
|
20
21
|
```
|
|
21
22
|
|
|
22
|
-
or using yarn:
|
|
23
|
-
|
|
24
|
-
```sh
|
|
25
|
-
yarn add @bluxcc/core
|
|
26
|
-
```
|
|
27
|
-
|
|
28
23
|
## Usage
|
|
29
24
|
|
|
30
|
-
Include Blux and set up the authentication flow:
|
|
31
|
-
|
|
32
25
|
```html
|
|
33
26
|
<!DOCTYPE html>
|
|
34
|
-
<
|
|
35
|
-
<head>
|
|
36
|
-
<title>Blux Example</title>
|
|
37
|
-
<script src="https://unpkg.com/@bluxcc/core/dist/index.iife.js"></script>
|
|
38
|
-
</head>
|
|
39
|
-
<body>
|
|
40
|
-
<button id="loginBtn">Login with Blux</button>
|
|
41
|
-
|
|
42
|
-
<script>
|
|
43
|
-
Blux.createConfig({
|
|
44
|
-
appName: 'your-app-name',
|
|
45
|
-
appId: 'get-id-from-dashboard',
|
|
46
|
-
networks: ['Public Global Stellar Network ; September 2015'],
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
document.getElementById('loginBtn').onclick = async () => {
|
|
50
|
-
const user = await Blux.Blux.login();
|
|
51
|
-
|
|
52
|
-
console.log('Logged in:', user);
|
|
53
|
-
};
|
|
54
|
-
</script>
|
|
55
|
-
</body>
|
|
56
|
-
</html>
|
|
57
|
-
```
|
|
27
|
+
<script src="https://unpkg.com/@bluxcc/core/dist/index.iife.js"></script>
|
|
58
28
|
|
|
59
|
-
|
|
29
|
+
<button id="loginBtn">Login with Blux</button>
|
|
60
30
|
|
|
61
|
-
|
|
31
|
+
<script>
|
|
32
|
+
Blux.createConfig({
|
|
33
|
+
appName: 'My App',
|
|
34
|
+
networks: [Blux.core.networks.mainnet],
|
|
35
|
+
});
|
|
62
36
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Configuration options can be passed in the `config` object when initializing Blux, or set via environment variables.
|
|
69
|
-
|
|
70
|
-
## Supported Wallets
|
|
71
|
-
|
|
72
|
-
Currently supported connection methods:
|
|
37
|
+
document.getElementById('loginBtn').onclick = async () => {
|
|
38
|
+
await Blux.blux.login();
|
|
39
|
+
};
|
|
40
|
+
</script>
|
|
41
|
+
```
|
|
73
42
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
- [x] **Lobstr**
|
|
77
|
-
- [x] **Freighter**
|
|
78
|
-
- [x] **Albedo**
|
|
79
|
-
- [x] **Hana**
|
|
80
|
-
- [ ] **Ledger**
|
|
81
|
-
- [ ] **Trezor**
|
|
82
|
-
- [ ] **WalletConnect**
|
|
83
|
-
- [ ] **OAuth**
|
|
84
|
-
- [ ] **Email**
|
|
43
|
+
```tsx
|
|
44
|
+
import { blux, core, createConfig } from '@bluxcc/core';
|
|
85
45
|
|
|
86
|
-
|
|
46
|
+
createConfig({
|
|
47
|
+
appName: 'My App',
|
|
48
|
+
networks: [core.networks.mainnet],
|
|
49
|
+
});
|
|
87
50
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
51
|
+
document.getElementById('loginBtn').onclick = async () => {
|
|
52
|
+
await blux.login();
|
|
53
|
+
};
|
|
54
|
+
```
|
|
91
55
|
|
|
92
56
|
## Support & Contact
|
|
93
57
|
|
|
@@ -96,13 +60,4 @@ For support, licensing, or inquiries, reach out via:
|
|
|
96
60
|
- **Email**: [support@blux.cc](mailto:support@blux.cc)
|
|
97
61
|
- **X (Twitter)**: [@BluxOfficial](https://twitter.com/BluxOfficial)
|
|
98
62
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
Blux is evolving. Follow our updates on [X (Twitter)](https://twitter.com/BluxOfficial) for:
|
|
102
|
-
|
|
103
|
-
- **OAuth Authentication (Apple, Meta, Google, etc.)**
|
|
104
|
-
- **Email & Phone-Based Authentication**
|
|
105
|
-
- **More Wallet Integrations**
|
|
106
|
-
- **Enhanced Customization & Security Features**
|
|
107
|
-
|
|
108
|
-
Stay tuned. We have many exciting developments ahead!
|
|
63
|
+
Follow for more updates at [X (Twitter)](https://twitter.com/BluxOfficial).
|
package/dist/assets/Icons.d.ts
CHANGED
|
@@ -56,6 +56,9 @@ export declare const WrongNetworkIcon: () => import("react/jsx-runtime").JSX.Ele
|
|
|
56
56
|
export declare const SwapIcon: ({ fill }: {
|
|
57
57
|
fill?: string;
|
|
58
58
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare const SmallSwapIcon: ({ fill }: {
|
|
60
|
+
fill?: string;
|
|
61
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
59
62
|
export declare const ReceiveIcon: ({ fill }: {
|
|
60
63
|
fill?: string;
|
|
61
64
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -96,3 +99,9 @@ export declare const ShieldIcon: ({ fill }: {
|
|
|
96
99
|
export declare const WalletIcon: ({ fill }: {
|
|
97
100
|
fill?: string;
|
|
98
101
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
102
|
+
export declare const QuestionMark: ({ fill }: {
|
|
103
|
+
fill?: string;
|
|
104
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
export declare const SmallQuestionMark: ({ fill }: {
|
|
106
|
+
fill?: string;
|
|
107
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
package/dist/assets/Logos.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const RabetLogo: ({ fill }: {
|
|
|
9
9
|
export declare const FreighterLogo: ({ fill }: {
|
|
10
10
|
fill?: string;
|
|
11
11
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const DarkFreighterLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export declare const XBullLogo: ({ fill }: {
|
|
13
14
|
fill?: string;
|
|
14
15
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -26,3 +27,4 @@ export declare const WalletConnectLogo: ({ fill, background, }: {
|
|
|
26
27
|
fill?: string;
|
|
27
28
|
background?: string;
|
|
28
29
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare const KleverLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
type ButtonSize =
|
|
3
|
-
type ButtonVariant =
|
|
4
|
-
type ButtonState =
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type ButtonSize = 'small' | 'medium' | 'large';
|
|
3
|
+
type ButtonVariant = 'outline' | 'text' | 'fill' | 'tonal';
|
|
4
|
+
type ButtonState = 'enabled' | 'disabled' | 'selected';
|
|
5
5
|
interface ButtonProps {
|
|
6
6
|
size?: ButtonSize;
|
|
7
7
|
variant?: ButtonVariant;
|
|
@@ -12,6 +12,8 @@ interface ButtonProps {
|
|
|
12
12
|
onClick?: () => void;
|
|
13
13
|
style?: React.CSSProperties;
|
|
14
14
|
className?: string;
|
|
15
|
+
type?: 'button' | 'submit';
|
|
16
|
+
disabled?: boolean;
|
|
15
17
|
}
|
|
16
|
-
declare const Button: ({ size, variant, state, children, startIcon, endIcon, onClick, style, className, }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare const Button: ({ size, disabled, variant, state, children, startIcon, endIcon, onClick, style, className, type, }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export default Button;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from 'react';
|
|
2
2
|
type CardItemProps = {
|
|
3
|
-
variant?:
|
|
4
|
-
size?:
|
|
3
|
+
variant?: 'social' | 'default' | 'input';
|
|
4
|
+
size?: 'small' | 'medium';
|
|
5
5
|
startIcon: React.ReactNode;
|
|
6
6
|
endArrow?: boolean;
|
|
7
7
|
isRecent?: boolean;
|
|
@@ -10,7 +10,7 @@ type CardItemProps = {
|
|
|
10
10
|
onChange?: (value: string) => void;
|
|
11
11
|
onEnter?: (value: string) => void;
|
|
12
12
|
onSubmit?: (value: string) => void;
|
|
13
|
-
inputType?:
|
|
13
|
+
inputType?: 'text' | 'password' | 'number' | 'email' | string;
|
|
14
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
16
|
export default CardItem;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from 'react';
|
|
2
2
|
type InputFieldProps = {
|
|
3
3
|
label?: string;
|
|
4
4
|
placeholder?: string;
|
|
5
5
|
error?: string;
|
|
6
|
-
type?:
|
|
6
|
+
type?: 'text' | 'password' | 'number';
|
|
7
7
|
iconRight?: React.ReactNode;
|
|
8
8
|
iconLeft?: React.ReactNode;
|
|
9
9
|
button?: string | React.ReactNode;
|
|
@@ -13,6 +13,7 @@ type InputFieldProps = {
|
|
|
13
13
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
14
|
customLabel?: React.ReactNode;
|
|
15
15
|
className?: string;
|
|
16
|
+
optionalField?: boolean;
|
|
16
17
|
};
|
|
17
|
-
declare const InputField: ({ label, autoFocus, type, placeholder, error, iconRight, iconLeft, button, onButtonClick, customLabel, value, className, onChange, }: InputFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare const InputField: ({ label, autoFocus, type, placeholder, error, iconRight, iconLeft, button, optionalField, onButtonClick, customLabel, value, className, onChange, }: InputFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export default InputField;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const XLM: {
|
|
2
|
+
assetIssuer: string;
|
|
3
|
+
assetCode: string;
|
|
4
|
+
assetBalance: string;
|
|
5
|
+
assetType: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const MAINNET_USDC: {
|
|
8
|
+
assetIssuer: string;
|
|
9
|
+
assetCode: string;
|
|
10
|
+
assetBalance: string;
|
|
11
|
+
assetType: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const TESTNET_USDC: {
|
|
14
|
+
assetIssuer: string;
|
|
15
|
+
assetCode: string;
|
|
16
|
+
assetBalance: string;
|
|
17
|
+
assetType: string;
|
|
18
|
+
};
|
package/dist/enums.d.ts
CHANGED
|
@@ -34,5 +34,6 @@ export declare enum Route {
|
|
|
34
34
|
ABOUT = "ABOUT",// View for what is blux
|
|
35
35
|
ADD_TOKEN = "ADD_TOKEN",// View for adding new token
|
|
36
36
|
SIGN_MESSAGE = "SIGN_MESSAGE",// User sign message view
|
|
37
|
-
WALLET_CONNECT = "WALLET_CONNECT"
|
|
37
|
+
WALLET_CONNECT = "WALLET_CONNECT",// User sign message view
|
|
38
|
+
SELECT_ASSET = "SELECT_ASSET"
|
|
38
39
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Horizon } from
|
|
2
|
-
type
|
|
1
|
+
import { Horizon } from '@stellar/stellar-sdk';
|
|
2
|
+
type GetBalancesOptions = {
|
|
3
3
|
address?: string;
|
|
4
4
|
network?: string;
|
|
5
5
|
includeZeroBalances?: boolean;
|
|
6
6
|
};
|
|
7
|
-
declare const getBalances: (options:
|
|
7
|
+
declare const getBalances: (options: GetBalancesOptions) => Promise<Horizon.HorizonApi.BalanceLine[]>;
|
|
8
8
|
export default getBalances;
|
package/dist/exports/utils.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Horizon, rpc } from
|
|
1
|
+
import { Horizon, rpc } from '@stellar/stellar-sdk';
|
|
2
2
|
export type CallBuilderOptions = {
|
|
3
3
|
cursor?: string;
|
|
4
4
|
limit?: number;
|
|
5
5
|
network?: string;
|
|
6
|
-
order?:
|
|
6
|
+
order?: 'asc' | 'desc';
|
|
7
7
|
};
|
|
8
8
|
export declare const checkConfigCreated: () => boolean;
|
|
9
9
|
export declare const getAddress: (address?: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useLockBodyScroll(lock: boolean): void;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export declare const useModalAnimation: (isOpen: boolean) => {
|
|
2
|
-
|
|
3
|
-
handleClose: (onClose: () => void) => void;
|
|
1
|
+
export declare const useModalAnimation: (isOpen: boolean, duration?: number) => {
|
|
2
|
+
handleClose: (onClose: () => void) => () => void;
|
|
4
3
|
isOpening: boolean;
|
|
5
4
|
isClosing: boolean;
|
|
6
|
-
hasTransition: boolean;
|
|
7
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Horizon } from
|
|
2
|
-
interface TransactionRecordWithOperations extends Omit<Horizon.ServerApi.TransactionRecord,
|
|
1
|
+
import { Horizon } from '@stellar/stellar-sdk';
|
|
2
|
+
interface TransactionRecordWithOperations extends Omit<Horizon.ServerApi.TransactionRecord, 'operations'> {
|
|
3
3
|
operations: Horizon.ServerApi.OperationRecord[];
|
|
4
4
|
}
|
|
5
5
|
export type UseTransactionsResult = {
|