@bluxcc/react 0.1.1 → 0.1.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 +2 -2
- package/dist/assets/Icons.d.ts +12 -1
- package/dist/assets/bluxLogo.d.ts +3 -1
- package/dist/assets/logos.d.ts +6 -1
- package/dist/chains.d.ts +8 -0
- package/dist/components/Button/index.d.ts +13 -6
- package/dist/components/CardItem/index.d.ts +10 -0
- package/dist/components/Input/OTPInput.d.ts +3 -0
- package/dist/components/Input/index.d.ts +16 -0
- package/dist/components/Modal/Header/index.d.ts +3 -3
- package/dist/components/Modal/index.d.ts +3 -4
- package/dist/components/Transaction/History/index.d.ts +10 -0
- package/dist/components/Transaction/Summery/index.d.ts +9 -0
- package/dist/constants/index.d.ts +6 -2
- package/dist/containers/BluxModal/content.d.ts +11 -0
- package/dist/containers/BluxModal/index.d.ts +7 -0
- package/dist/containers/ConnectModal/content.d.ts +11 -0
- package/dist/containers/ConnectModal/index.d.ts +2 -1
- package/dist/containers/Pages/Activity/index.d.ts +3 -0
- package/dist/containers/Pages/ConfirmCode/index.d.ts +3 -0
- package/dist/containers/Pages/OnBoarding/index.d.ts +7 -0
- package/dist/containers/Pages/Profile/index.d.ts +3 -0
- package/dist/containers/Pages/Send/index.d.ts +3 -0
- package/dist/containers/Pages/SignTransaction/index.d.ts +3 -0
- package/dist/containers/Pages/Successful/index.d.ts +3 -0
- package/dist/containers/Pages/Waiting/index.d.ts +3 -0
- package/dist/context/provider.d.ts +1 -1
- package/dist/hooks/useAccount.d.ts +12 -0
- package/dist/hooks/useBlux.d.ts +4 -2
- package/dist/index.cjs.js +1405 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +1399 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/types/index.d.ts +94 -20
- package/dist/useStellar/index.d.ts +2 -0
- package/dist/useStellar/useBalance.d.ts +8 -0
- package/dist/utils/BN.d.ts +3 -0
- package/dist/utils/capitalizeFirstLetter.d.ts +2 -0
- package/dist/utils/getBorderRadius.d.ts +2 -1
- package/dist/utils/getContrastColor.d.ts +2 -0
- package/dist/utils/getHorizonServer.d.ts +6 -0
- package/dist/utils/getInitialHeight.d.ts +2 -0
- package/dist/utils/getNetworkByPassphrase.d.ts +1 -2
- package/dist/utils/getTransactionDetails.d.ts +6 -0
- package/dist/utils/handleIcons.d.ts +2 -1
- package/dist/utils/handleLogos.d.ts +3 -0
- package/dist/utils/humanizeAmount.d.ts +3 -0
- package/dist/utils/initializeRabetMobile.d.ts +2 -1
- package/dist/utils/mappedWallets.d.ts +4 -3
- package/dist/utils/signTransactionHandler.d.ts +3 -0
- package/dist/utils/stellar/getExplorerUrl.d.ts +2 -0
- package/dist/utils/stellar/getNetworkByPassphrase.d.ts +2 -0
- package/dist/utils/stellar/getNetworkPassphrase.d.ts +2 -0
- package/dist/utils/stellar/getStellarServer.d.ts +6 -0
- package/dist/utils/stellar/getTransactionDetails.d.ts +7 -0
- package/dist/utils/stellar/signTransaction.d.ts +3 -0
- package/dist/utils/stellar/submitTransaction.d.ts +3 -0
- package/dist/utils/submitTransaction.d.ts +2 -0
- package/dist/wallets/configs/albedoConfig.d.ts +2 -2
- package/dist/wallets/configs/freighterConfig.d.ts +2 -2
- package/dist/wallets/configs/lobstrConfig.d.ts +2 -2
- package/dist/wallets/configs/rabetConfig.d.ts +2 -2
- package/dist/wallets/configs/xbullConfig.d.ts +2 -2
- package/dist/wallets/walletsConfig.d.ts +2 -2
- package/package.json +4 -8
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Import Blux and set up the authentication flow:
|
|
|
32
32
|
```tsx
|
|
33
33
|
import { BluxProvider, useBlux } from "@bluxcc/react";
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
const ConnectButton = () => {
|
|
36
36
|
const { connect } = useBlux();
|
|
37
37
|
return <button onClick={connect}>Connect Wallet</button>;
|
|
38
38
|
};
|
|
@@ -40,7 +40,7 @@ const YourComponent = () => {
|
|
|
40
40
|
const App = () => {
|
|
41
41
|
return (
|
|
42
42
|
<BluxProvider config={{ appName: "YourApp", network: "testnet" }}>
|
|
43
|
-
<
|
|
43
|
+
<ConnectButton />
|
|
44
44
|
</BluxProvider>
|
|
45
45
|
);
|
|
46
46
|
};
|
package/dist/assets/Icons.d.ts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const InfoIcon: (
|
|
2
|
+
export declare const InfoIcon: ({ fill }: {
|
|
3
|
+
fill?: string;
|
|
4
|
+
}) => React.JSX.Element;
|
|
3
5
|
export declare const ArrowRight: () => React.JSX.Element;
|
|
4
6
|
export declare const ArrowLeft: () => React.JSX.Element;
|
|
5
7
|
export declare const Close: () => React.JSX.Element;
|
|
6
8
|
export declare const Loading: () => React.JSX.Element;
|
|
9
|
+
export declare const GreenCheck: () => React.JSX.Element;
|
|
10
|
+
export declare const LogOut: () => React.JSX.Element;
|
|
11
|
+
export declare const Copy: () => React.JSX.Element;
|
|
12
|
+
export declare const History: () => React.JSX.Element;
|
|
13
|
+
export declare const Send: () => React.JSX.Element;
|
|
14
|
+
export declare const ArrowDropUp: () => React.JSX.Element;
|
|
15
|
+
export declare const RedAlert: () => React.JSX.Element;
|
|
16
|
+
export declare const Upstream: () => React.JSX.Element;
|
|
17
|
+
export declare const Globe: () => React.JSX.Element;
|
package/dist/assets/logos.d.ts
CHANGED
|
@@ -4,4 +4,9 @@ export declare const RabetIcon: () => React.JSX.Element;
|
|
|
4
4
|
export declare const FreighterIcon: () => React.JSX.Element;
|
|
5
5
|
export declare const XBullIcon: () => React.JSX.Element;
|
|
6
6
|
export declare const LobstrIcon: () => React.JSX.Element;
|
|
7
|
-
export declare const StellarIcon: (
|
|
7
|
+
export declare const StellarIcon: ({ fill }: {
|
|
8
|
+
fill?: string;
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
|
+
export declare const StellarSmallIcon: ({ fill }: {
|
|
11
|
+
fill?: string;
|
|
12
|
+
}) => React.JSX.Element;
|
package/dist/chains.d.ts
ADDED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type ButtonSize = 'small' | 'medium' | 'large';
|
|
3
|
+
type ButtonVariant = 'outline' | 'text' | 'fill';
|
|
4
|
+
type ButtonState = 'enabled' | 'disabled' | 'selected';
|
|
5
|
+
interface ButtonProps {
|
|
6
|
+
size?: ButtonSize;
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
state?: ButtonState;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
startIcon?: React.ReactNode;
|
|
11
|
+
endIcon?: React.ReactNode;
|
|
4
12
|
onClick?: () => void;
|
|
5
|
-
|
|
13
|
+
style?: React.CSSProperties;
|
|
6
14
|
className?: string;
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
declare const Button: ({ onClick, className, disabled, children }: ButtonProps) => React.JSX.Element;
|
|
15
|
+
}
|
|
16
|
+
declare const Button: ({ size, variant, state, children, startIcon, endIcon, onClick, style, className, }: ButtonProps) => React.JSX.Element;
|
|
10
17
|
export default Button;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type CardItemProps = {
|
|
3
|
+
variant?: 'social' | 'default';
|
|
4
|
+
startIcon: React.ReactNode;
|
|
5
|
+
endArrow?: boolean;
|
|
6
|
+
label: string;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
};
|
|
9
|
+
declare const CardItem: React.FC<CardItemProps>;
|
|
10
|
+
export default CardItem;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type InputFieldProps = {
|
|
3
|
+
label?: string;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
error?: boolean;
|
|
6
|
+
helperText?: string;
|
|
7
|
+
iconRight?: React.ReactNode;
|
|
8
|
+
iconLeft?: React.ReactNode;
|
|
9
|
+
button?: string | React.ReactNode;
|
|
10
|
+
onButtonClick?: () => void;
|
|
11
|
+
value?: string;
|
|
12
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
customLabel?: React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
declare const InputField: ({ label, placeholder, error, helperText, iconRight, iconLeft, button, onButtonClick, customLabel, value, onChange, }: InputFieldProps) => React.JSX.Element;
|
|
16
|
+
export default InputField;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface HeaderProps {
|
|
3
|
-
icon
|
|
3
|
+
icon?: 'info' | 'back';
|
|
4
4
|
onInfo?: () => void;
|
|
5
5
|
onBack?: () => void;
|
|
6
|
-
|
|
6
|
+
title: string;
|
|
7
7
|
closeButton?: boolean;
|
|
8
8
|
onClose: () => void;
|
|
9
9
|
}
|
|
10
|
-
declare const ModalHeader: React.
|
|
10
|
+
declare const ModalHeader: ({ icon, onInfo, onBack, title, closeButton, onClose, }: HeaderProps) => React.JSX.Element;
|
|
11
11
|
export default ModalHeader;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface ModalProps {
|
|
3
3
|
isOpen: boolean;
|
|
4
|
-
className?: string;
|
|
5
4
|
onClose?: () => void;
|
|
6
5
|
onBack?: () => void;
|
|
7
6
|
children: React.ReactNode;
|
|
8
|
-
icon
|
|
7
|
+
icon?: 'info' | 'back';
|
|
9
8
|
onInfo?: () => void;
|
|
10
9
|
closeButton?: boolean;
|
|
11
|
-
|
|
10
|
+
title: string;
|
|
12
11
|
initialHeight: number;
|
|
13
12
|
}
|
|
14
|
-
declare const Modal: ({ isOpen, onClose, onBack, onInfo, children,
|
|
13
|
+
declare const Modal: ({ isOpen, onClose, onBack, onInfo, children, title, icon, initialHeight, closeButton, }: ModalProps) => React.JSX.Element | null;
|
|
15
14
|
export default Modal;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface TransactionProps {
|
|
3
|
+
amount: string;
|
|
4
|
+
date: string;
|
|
5
|
+
status: 'success' | 'failed' | string;
|
|
6
|
+
action: string;
|
|
7
|
+
hash: string;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.MemoExoticComponent<({ amount, date, status, action, hash }: TransactionProps) => React.JSX.Element>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface SummaryProps {
|
|
3
|
+
operationsCount: number;
|
|
4
|
+
sender: string;
|
|
5
|
+
estimatedFee: string;
|
|
6
|
+
action: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Summary: ({ operationsCount, sender, estimatedFee, action }: SummaryProps) => React.JSX.Element;
|
|
9
|
+
export default Summary;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ModalHeights } from '../types';
|
|
2
|
+
import { IAppearance } from '../types';
|
|
2
3
|
export declare const MODAL_HEIGHTS: ModalHeights;
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
4
|
+
export declare const HORIZON_SERVERS: {
|
|
5
|
+
public: string;
|
|
6
|
+
testnet: string;
|
|
7
|
+
futurenet: string;
|
|
5
8
|
};
|
|
9
|
+
export declare const defaultAppearance: IAppearance;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Routes } from '../../types';
|
|
3
|
+
interface ModalContentProps {
|
|
4
|
+
showAllWallets: boolean;
|
|
5
|
+
setShowAllWallets: (show: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const modalContent: Record<Routes, {
|
|
8
|
+
title: string;
|
|
9
|
+
Component: React.FC<ModalContentProps>;
|
|
10
|
+
}>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Routes } from '../../types';
|
|
3
|
+
interface ModalContentProps {
|
|
4
|
+
showAllWallets: boolean;
|
|
5
|
+
setShowAllWallets: (show: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const modalContent: Record<Routes, {
|
|
8
|
+
title: string;
|
|
9
|
+
Component: React.FC<ModalContentProps>;
|
|
10
|
+
}>;
|
|
11
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface ConnectModalProps {
|
|
3
3
|
isOpen: boolean;
|
|
4
|
+
closeModal: () => void;
|
|
4
5
|
}
|
|
5
|
-
export default function ConnectModal({ isOpen }: ConnectModalProps): React.JSX.Element;
|
|
6
|
+
export default function ConnectModal({ isOpen, closeModal }: ConnectModalProps): React.JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type OnBoardingProps = {
|
|
3
|
+
showAllWallets: boolean;
|
|
4
|
+
setShowAllWallets: (value: boolean) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const OnBoarding: ({ showAllWallets, setShowAllWallets }: OnBoardingProps) => React.JSX.Element;
|
|
7
|
+
export default OnBoarding;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ContextState, IProviderConfig, IAppearance } from '../types';
|
|
3
3
|
export declare const ProviderContext: React.Context<ContextState | null>;
|
|
4
|
-
export declare const defaultAppearance: IAppearance;
|
|
5
4
|
export declare const BluxProvider: ({ config, isDemo, appearance, children, }: {
|
|
6
5
|
isDemo?: boolean;
|
|
7
6
|
appearance?: IAppearance;
|
|
8
7
|
config: IProviderConfig;
|
|
9
8
|
children: React.ReactNode;
|
|
10
9
|
}) => React.JSX.Element;
|
|
10
|
+
export declare const useProvider: () => ContextState;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AccountData } from '../types';
|
|
2
|
+
interface AccountHookResult {
|
|
3
|
+
account: AccountData | null;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
error: string | null;
|
|
6
|
+
}
|
|
7
|
+
interface AccountHookProps {
|
|
8
|
+
publicKey: string;
|
|
9
|
+
passphrase: string;
|
|
10
|
+
}
|
|
11
|
+
declare const useAccount: ({ publicKey, passphrase }: AccountHookProps) => AccountHookResult;
|
|
12
|
+
export default useAccount;
|
package/dist/hooks/useBlux.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const useBlux: () => {
|
|
2
|
-
connect: () =>
|
|
3
|
-
disconnect: () =>
|
|
2
|
+
connect: () => void;
|
|
3
|
+
disconnect: () => void;
|
|
4
|
+
profile: () => void;
|
|
5
|
+
signTransaction: (xdr: string) => Promise<unknown>;
|
|
4
6
|
isReady: boolean;
|
|
5
7
|
user: import("../types").IUser;
|
|
6
8
|
isAuthenticated: boolean;
|