@bluxcc/react 0.1.1 → 0.1.3

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.
Files changed (68) hide show
  1. package/README.md +2 -2
  2. package/dist/assets/Icons.d.ts +14 -1
  3. package/dist/assets/bluxLogo.d.ts +3 -1
  4. package/dist/assets/logos.d.ts +12 -6
  5. package/dist/chains.d.ts +8 -0
  6. package/dist/components/Button/index.d.ts +13 -6
  7. package/dist/components/CardItem/index.d.ts +14 -0
  8. package/dist/components/Input/OTPInput.d.ts +8 -0
  9. package/dist/components/Input/index.d.ts +16 -0
  10. package/dist/components/Modal/Header/index.d.ts +3 -3
  11. package/dist/components/Modal/index.d.ts +3 -5
  12. package/dist/components/Transaction/History/index.d.ts +10 -0
  13. package/dist/components/Transaction/Summery/index.d.ts +9 -0
  14. package/dist/constants/index.d.ts +6 -4
  15. package/dist/containers/BluxModal/content.d.ts +11 -0
  16. package/dist/containers/BluxModal/index.d.ts +7 -0
  17. package/dist/containers/ConnectModal/content.d.ts +11 -0
  18. package/dist/containers/ConnectModal/index.d.ts +2 -1
  19. package/dist/containers/Pages/Activity/index.d.ts +3 -0
  20. package/dist/containers/Pages/ConfirmCode/index.d.ts +3 -0
  21. package/dist/containers/Pages/OnBoarding/index.d.ts +7 -0
  22. package/dist/containers/Pages/Profile/index.d.ts +3 -0
  23. package/dist/containers/Pages/Send/index.d.ts +3 -0
  24. package/dist/containers/Pages/SignTransaction/index.d.ts +3 -0
  25. package/dist/containers/Pages/Successful/index.d.ts +3 -0
  26. package/dist/containers/Pages/Waiting/index.d.ts +3 -0
  27. package/dist/context/provider.d.ts +3 -4
  28. package/dist/hooks/useAccount.d.ts +12 -0
  29. package/dist/hooks/useBlux.d.ts +4 -2
  30. package/dist/index.cjs.js +1 -1
  31. package/dist/index.cjs.js.map +1 -1
  32. package/dist/index.d.ts +3 -0
  33. package/dist/index.esm.js +1 -1
  34. package/dist/index.esm.js.map +1 -1
  35. package/dist/networks.d.ts +8 -0
  36. package/dist/types/index.d.ts +114 -23
  37. package/dist/useStellar/index.d.ts +2 -0
  38. package/dist/useStellar/useBalance.d.ts +8 -0
  39. package/dist/utils/BN.d.ts +3 -0
  40. package/dist/utils/capitalizeFirstLetter.d.ts +2 -0
  41. package/dist/utils/getBorderRadius.d.ts +2 -1
  42. package/dist/utils/getContrastColor.d.ts +2 -0
  43. package/dist/utils/getHorizonServer.d.ts +6 -0
  44. package/dist/utils/getInitialHeight.d.ts +2 -0
  45. package/dist/utils/getNetworkByPassphrase.d.ts +1 -2
  46. package/dist/utils/getTransactionDetails.d.ts +6 -0
  47. package/dist/utils/handleIcons.d.ts +2 -1
  48. package/dist/utils/handleLogos.d.ts +3 -0
  49. package/dist/utils/humanizeAmount.d.ts +3 -0
  50. package/dist/utils/initializeRabetMobile.d.ts +2 -1
  51. package/dist/utils/mappedWallets.d.ts +4 -3
  52. package/dist/utils/setWalletNetwork.d.ts +3 -0
  53. package/dist/utils/signTransactionHandler.d.ts +3 -0
  54. package/dist/utils/stellar/getExplorerUrl.d.ts +2 -0
  55. package/dist/utils/stellar/getNetworkByPassphrase.d.ts +2 -0
  56. package/dist/utils/stellar/getNetworkPassphrase.d.ts +2 -0
  57. package/dist/utils/stellar/getStellarServer.d.ts +6 -0
  58. package/dist/utils/stellar/getTransactionDetails.d.ts +7 -0
  59. package/dist/utils/stellar/signTransaction.d.ts +3 -0
  60. package/dist/utils/stellar/submitTransaction.d.ts +3 -0
  61. package/dist/utils/submitTransaction.d.ts +2 -0
  62. package/dist/wallets/configs/albedoConfig.d.ts +2 -2
  63. package/dist/wallets/configs/freighterConfig.d.ts +2 -2
  64. package/dist/wallets/configs/lobstrConfig.d.ts +2 -2
  65. package/dist/wallets/configs/rabetConfig.d.ts +2 -2
  66. package/dist/wallets/configs/xbullConfig.d.ts +2 -2
  67. package/dist/wallets/walletsConfig.d.ts +2 -2
  68. 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 YourComponent = () => {
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
- <YourComponent />
43
+ <ConnectButton />
44
44
  </BluxProvider>
45
45
  );
46
46
  };
@@ -1,6 +1,19 @@
1
1
  import React from 'react';
2
- export declare const InfoIcon: () => React.JSX.Element;
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;
18
+ export declare const SmallEmailIcon: () => React.JSX.Element;
19
+ export declare const EmailIcon: () => React.JSX.Element;
@@ -1,3 +1,5 @@
1
1
  import React from 'react';
2
- declare const BluxLogo: () => React.JSX.Element;
2
+ declare const BluxLogo: ({ fill }: {
3
+ fill?: string;
4
+ }) => React.JSX.Element;
3
5
  export default BluxLogo;
@@ -1,7 +1,13 @@
1
1
  import React from 'react';
2
- export declare const AlbedoIcon: () => React.JSX.Element;
3
- export declare const RabetIcon: () => React.JSX.Element;
4
- export declare const FreighterIcon: () => React.JSX.Element;
5
- export declare const XBullIcon: () => React.JSX.Element;
6
- export declare const LobstrIcon: () => React.JSX.Element;
7
- export declare const StellarIcon: () => React.JSX.Element;
2
+ export declare const AlbedoLogo: () => React.JSX.Element;
3
+ export declare const RabetLogo: () => React.JSX.Element;
4
+ export declare const FreighterLogo: () => React.JSX.Element;
5
+ export declare const XBullLogo: () => React.JSX.Element;
6
+ export declare const LobstrLogo: () => React.JSX.Element;
7
+ export declare const StellarLogo: ({ fill }: {
8
+ fill?: string;
9
+ }) => React.JSX.Element;
10
+ export declare const StellarSmallLogo: ({ fill }: {
11
+ fill?: string;
12
+ }) => React.JSX.Element;
13
+ export declare const GoogleLogo: () => React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { Networks } from "@stellar/stellar-sdk";
2
+ export declare const chains: {
3
+ mainnet: Networks;
4
+ testnet: Networks;
5
+ sandbox: Networks;
6
+ futurenet: Networks;
7
+ standalone: Networks;
8
+ };
@@ -1,10 +1,17 @@
1
1
  import React from 'react';
2
- export type ButtonProps = {
3
- name?: string;
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
- children?: React.ReactNode;
13
+ style?: React.CSSProperties;
6
14
  className?: string;
7
- disabled?: boolean;
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,14 @@
1
+ import React from 'react';
2
+ type CardItemProps = {
3
+ variant?: 'social' | 'default' | 'input';
4
+ startIcon: React.ReactNode;
5
+ endArrow?: boolean;
6
+ label?: string;
7
+ onClick?: () => void;
8
+ onChange?: (value: string) => void;
9
+ onEnter?: (value: string) => void;
10
+ onSubmit?: (value: string) => void;
11
+ inputType?: 'text' | 'password' | 'number' | 'email' | string;
12
+ };
13
+ declare const CardItem: ({ variant, startIcon, endArrow, label, onClick, onChange, onEnter, onSubmit, inputType, }: CardItemProps) => React.JSX.Element;
14
+ export default CardItem;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface OTPInputProps {
3
+ otp: string[];
4
+ setOtp: (otp: string[]) => void;
5
+ error?: boolean;
6
+ }
7
+ declare const OTPInput: React.FC<OTPInputProps>;
8
+ export default OTPInput;
@@ -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: 'info' | 'back';
3
+ icon?: 'info' | 'back';
4
4
  onInfo?: () => void;
5
5
  onBack?: () => void;
6
- modalHeader: string;
6
+ title: string;
7
7
  closeButton?: boolean;
8
8
  onClose: () => void;
9
9
  }
10
- declare const ModalHeader: React.FC<HeaderProps>;
10
+ declare const ModalHeader: ({ icon, onInfo, onBack, title, closeButton, onClose, }: HeaderProps) => React.JSX.Element;
11
11
  export default ModalHeader;
@@ -1,15 +1,13 @@
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: 'info' | 'back';
7
+ icon?: 'info' | 'back';
9
8
  onInfo?: () => void;
10
9
  closeButton?: boolean;
11
- modalHeader: string;
12
- initialHeight: number;
10
+ title: string;
13
11
  }
14
- declare const Modal: ({ isOpen, onClose, onBack, onInfo, children, className, modalHeader, icon, initialHeight, closeButton, }: ModalProps) => React.JSX.Element | null;
12
+ declare const Modal: ({ isOpen, onClose, onBack, onInfo, children, title, icon, closeButton, }: ModalProps) => React.JSX.Element | null;
15
13
  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,7 @@
1
- import { ModalHeights } from '../types';
2
- export declare const MODAL_HEIGHTS: ModalHeights;
3
- export declare const MODAL_CONFIG: {
4
- readonly defaultHeader: "Connect Wallet";
1
+ import { IAppearance } from '../types';
2
+ export declare const HORIZON_SERVERS: {
3
+ public: string;
4
+ testnet: string;
5
+ futurenet: string;
5
6
  };
7
+ 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,7 @@
1
+ import React from 'react';
2
+ interface BluxModalProps {
3
+ isOpen: boolean;
4
+ closeModal: () => void;
5
+ }
6
+ export default function BluxModal({ isOpen, closeModal }: BluxModalProps): React.JSX.Element;
7
+ 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,3 @@
1
+ import React from 'react';
2
+ declare const Activity: React.FC;
3
+ export default Activity;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const ConfirmCode: React.FC;
3
+ export default ConfirmCode;
@@ -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;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Profile: () => React.JSX.Element;
3
+ export default Profile;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Send: () => React.JSX.Element;
3
+ export default Send;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const SignTransaction: () => React.JSX.Element;
3
+ export default SignTransaction;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Successful: () => React.JSX.Element;
3
+ export default Successful;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Waiting: () => React.JSX.Element;
3
+ export default Waiting;
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- import { ContextState, IProviderConfig, IAppearance } from '../types';
2
+ import { ContextState, IProviderConfig } from '../types';
3
3
  export declare const ProviderContext: React.Context<ContextState | null>;
4
- export declare const defaultAppearance: IAppearance;
5
- export declare const BluxProvider: ({ config, isDemo, appearance, children, }: {
4
+ export declare const BluxProvider: ({ config, isDemo, children, }: {
6
5
  isDemo?: boolean;
7
- appearance?: IAppearance;
8
6
  config: IProviderConfig;
9
7
  children: React.ReactNode;
10
8
  }) => React.JSX.Element;
9
+ 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;
@@ -1,6 +1,8 @@
1
1
  export declare const useBlux: () => {
2
- connect: () => Promise<void>;
3
- disconnect: () => Promise<void>;
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;