@bluxcc/react 0.1.21 → 0.1.23

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 (86) hide show
  1. package/dist/Provider.d.ts +8 -0
  2. package/dist/hooks/useBlux.d.ts +10 -14
  3. package/dist/index.cjs.js +1 -1
  4. package/dist/index.d.ts +1 -6
  5. package/dist/index.esm.js +1 -1
  6. package/dist/useStellar/index.d.ts +4 -6
  7. package/dist/useStellar/useAccount.d.ts +5 -10
  8. package/dist/useStellar/useNetwork.d.ts +1 -2
  9. package/dist/useStellar/useSwitchNetwork.d.ts +8 -3
  10. package/package.json +4 -10
  11. package/dist/assets/Icons.d.ts +0 -47
  12. package/dist/assets/bluxLogo.d.ts +0 -5
  13. package/dist/assets/logos.d.ts +0 -25
  14. package/dist/components/Button/index.d.ts +0 -17
  15. package/dist/components/CardItem/index.d.ts +0 -15
  16. package/dist/components/Input/OTPInput.d.ts +0 -8
  17. package/dist/components/Input/index.d.ts +0 -18
  18. package/dist/components/Modal/Backdrop/index.d.ts +0 -8
  19. package/dist/components/Modal/Header/index.d.ts +0 -11
  20. package/dist/components/Modal/index.d.ts +0 -14
  21. package/dist/components/Transaction/History/index.d.ts +0 -12
  22. package/dist/components/Transaction/Summary/index.d.ts +0 -11
  23. package/dist/constants/explorers.d.ts +0 -9
  24. package/dist/constants/index.d.ts +0 -4
  25. package/dist/constants/locales.d.ts +0 -9
  26. package/dist/constants/networkDetails.d.ts +0 -8
  27. package/dist/constants/storageKeys.d.ts +0 -1
  28. package/dist/containers/BluxModal/content.d.ts +0 -10
  29. package/dist/containers/BluxModal/index.d.ts +0 -7
  30. package/dist/containers/Pages/Activity/index.d.ts +0 -3
  31. package/dist/containers/Pages/ConfirmCode/index.d.ts +0 -3
  32. package/dist/containers/Pages/OnBoarding/index.d.ts +0 -3
  33. package/dist/containers/Pages/Profile/index.d.ts +0 -3
  34. package/dist/containers/Pages/SelectAsset/index.d.ts +0 -9
  35. package/dist/containers/Pages/Send/SendForm.d.ts +0 -3
  36. package/dist/containers/Pages/Send/index.d.ts +0 -3
  37. package/dist/containers/Pages/SignTransaction/index.d.ts +0 -3
  38. package/dist/containers/Pages/Successful/index.d.ts +0 -3
  39. package/dist/containers/Pages/Waiting/index.d.ts +0 -3
  40. package/dist/containers/Pages/WrongNetwork/index.d.ts +0 -3
  41. package/dist/context/provider.d.ts +0 -11
  42. package/dist/context/useCheckWalletNetwork.d.ts +0 -3
  43. package/dist/hooks/useCheckProvider.d.ts +0 -2
  44. package/dist/hooks/useCustomNetwork.d.ts +0 -7
  45. package/dist/hooks/useLang.d.ts +0 -2
  46. package/dist/hooks/useModalAnimation.d.ts +0 -7
  47. package/dist/networks.d.ts +0 -8
  48. package/dist/types/index.d.ts +0 -248
  49. package/dist/useStellar/useBalance.d.ts +0 -13
  50. package/dist/useStellar/useTransactions.d.ts +0 -18
  51. package/dist/utils/apis/getAssetLogos.d.ts +0 -12
  52. package/dist/utils/capitalizeFirstLetter.d.ts +0 -2
  53. package/dist/utils/copyText.d.ts +0 -2
  54. package/dist/utils/formatDate.d.ts +0 -2
  55. package/dist/utils/getContrastColor.d.ts +0 -2
  56. package/dist/utils/getWalletNetwork.d.ts +0 -3
  57. package/dist/utils/handleLogos.d.ts +0 -3
  58. package/dist/utils/hexToRgba.d.ts +0 -2
  59. package/dist/utils/humanizeAmount.d.ts +0 -3
  60. package/dist/utils/initializeRabetMobile.d.ts +0 -2
  61. package/dist/utils/isBackgroundDark.d.ts +0 -2
  62. package/dist/utils/mappedWallets.d.ts +0 -3
  63. package/dist/utils/network/getNetworkRpc.d.ts +0 -4
  64. package/dist/utils/network/getNetworkTitle.d.ts +0 -2
  65. package/dist/utils/network/url.d.ts +0 -12
  66. package/dist/utils/setRecentConnectionMethod.d.ts +0 -3
  67. package/dist/utils/shortenAddress.d.ts +0 -2
  68. package/dist/utils/sortWallets.d.ts +0 -3
  69. package/dist/utils/stellar/finalizeSorobanTransaction.d.ts +0 -3
  70. package/dist/utils/stellar/getExplorerUrl.d.ts +0 -3
  71. package/dist/utils/stellar/getNetworkByPassphrase.d.ts +0 -2
  72. package/dist/utils/stellar/getTransactionDetails.d.ts +0 -8
  73. package/dist/utils/stellar/handleTransactionSigning.d.ts +0 -3
  74. package/dist/utils/stellar/paymentTransaction.d.ts +0 -4
  75. package/dist/utils/stellar/signTransaction.d.ts +0 -3
  76. package/dist/utils/stellar/submitTransaction.d.ts +0 -10
  77. package/dist/utils/toTitleFormat.d.ts +0 -2
  78. package/dist/utils/translate.d.ts +0 -2
  79. package/dist/wallets/configs/albedoConfig.d.ts +0 -2
  80. package/dist/wallets/configs/freighterConfig.d.ts +0 -2
  81. package/dist/wallets/configs/hanaConfig.d.ts +0 -2
  82. package/dist/wallets/configs/hotConfig.d.ts +0 -2
  83. package/dist/wallets/configs/lobstrConfig.d.ts +0 -2
  84. package/dist/wallets/configs/rabetConfig.d.ts +0 -2
  85. package/dist/wallets/configs/xbullConfig.d.ts +0 -2
  86. package/dist/wallets/walletsConfig.d.ts +0 -2
@@ -1,6 +1,4 @@
1
- import useAccount from './useAccount';
2
- import useBalance from './useBalance';
3
- import useNetwork from './useNetwork';
4
- import useTransactions from './useTransactions';
5
- import useSwitchNetwork from './useSwitchNetwork';
6
- export { useAccount, useBalance, useNetwork, useTransactions, useSwitchNetwork, };
1
+ export { networks } from '@bluxcc/core';
2
+ export * from './useAccount';
3
+ export * from './useNetwork';
4
+ export { useSwitchNetwork } from './useSwitchNetwork';
@@ -1,12 +1,7 @@
1
- import { Horizon } from '@stellar/stellar-sdk';
2
- interface UseAccountProps {
3
- address?: string;
4
- network?: string;
5
- }
6
- export interface UseAccountResult {
1
+ import { GetAccountResult, GetAccountOptions } from '@bluxcc/core/dist/exports/core/getAccount';
2
+ export type UseAccountResult = {
7
3
  loading: boolean;
8
4
  error: Error | null;
9
- account: Horizon.AccountResponse | null;
10
- }
11
- declare const useAccount: (params?: UseAccountProps) => UseAccountResult;
12
- export default useAccount;
5
+ result: GetAccountResult;
6
+ };
7
+ export declare function useAccount(options: GetAccountOptions): UseAccountResult;
@@ -1,2 +1 @@
1
- declare const useNetwork: () => string;
2
- export default useNetwork;
1
+ export declare const useNetwork: () => string;
@@ -1,5 +1,10 @@
1
- declare const useSwitchNetwork: () => {
1
+ export declare const useSwitchNetwork: () => {
2
+ networks: {
3
+ mainnet: import("@stellar/stellar-base").Networks;
4
+ testnet: import("@stellar/stellar-base").Networks;
5
+ sandbox: import("@stellar/stellar-base").Networks;
6
+ futurenet: import("@stellar/stellar-base").Networks;
7
+ standalone: import("@stellar/stellar-base").Networks;
8
+ };
2
9
  switchNetwork: (newNetwork: string) => void;
3
- networks: string[];
4
10
  };
5
- export default useSwitchNetwork;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bluxcc/react",
3
3
  "author": "Blux team",
4
- "version": "0.1.21",
4
+ "version": "0.1.23",
5
5
  "homepage": "https://blux.cc",
6
6
  "description": "Connecting to the Stellar Ecosystem and Beyond",
7
7
  "repository": {
@@ -9,7 +9,7 @@
9
9
  "url": "git+https://github.com/bluxcc/blux"
10
10
  },
11
11
  "type": "module",
12
- "main": "dist/index.esm.js",
12
+ "main": "dist/index.cjs.js",
13
13
  "module": "dist/index.esm.js",
14
14
  "types": "dist/index.d.ts",
15
15
  "exports": {
@@ -30,10 +30,7 @@
30
30
  "build": "rollup -c rollup.config.prod.js"
31
31
  },
32
32
  "peerDependencies": {
33
- "@albedo-link/intent": "^0.12.0",
34
- "@lobstrco/signer-extension-api": "^1.0.0-beta.0",
35
- "@stellar/freighter-api": "^3.0.0",
36
- "@stellar/stellar-sdk": "^13.1.0",
33
+ "@bluxcc/core": "^0.1.12",
37
34
  "react": ">=17.0.0",
38
35
  "react-dom": ">=17.0.0"
39
36
  },
@@ -71,8 +68,5 @@
71
68
  },
72
69
  "sideEffects": [
73
70
  "*.css"
74
- ],
75
- "dependencies": {
76
- "@hot-wallet/sdk": "^1.0.11"
77
- }
71
+ ]
78
72
  }
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- export declare const InfoIcon: ({ fill }: {
3
- fill?: string;
4
- }) => React.JSX.Element;
5
- export declare const ArrowRight: ({ fill }: {
6
- fill?: string;
7
- }) => React.JSX.Element;
8
- export declare const ArrowLeft: ({ fill }: {
9
- fill?: string;
10
- }) => React.JSX.Element;
11
- export declare const Close: ({ fill }: {
12
- fill?: string;
13
- }) => React.JSX.Element;
14
- export declare const Loading: ({ fill }: {
15
- fill?: string;
16
- }) => React.JSX.Element;
17
- export declare const Search: ({ fill }: {
18
- fill?: string;
19
- }) => React.JSX.Element;
20
- export declare const GreenCheck: () => React.JSX.Element;
21
- export declare const LogOut: ({ fill }: {
22
- fill?: string;
23
- }) => React.JSX.Element;
24
- export declare const Copy: ({ fill }: {
25
- fill?: string;
26
- }) => React.JSX.Element;
27
- export declare const History: ({ fill }: {
28
- fill?: string;
29
- }) => React.JSX.Element;
30
- export declare const Send: ({ fill }: {
31
- fill?: string;
32
- }) => React.JSX.Element;
33
- export declare const ArrowDropUp: ({ fill }: {
34
- fill?: string;
35
- }) => React.JSX.Element;
36
- export declare const RedAlert: () => React.JSX.Element;
37
- export declare const Upstream: () => React.JSX.Element;
38
- export declare const MultiOperation: () => React.JSX.Element;
39
- export declare const Downstream: () => React.JSX.Element;
40
- export declare const Globe: () => React.JSX.Element;
41
- export declare const SmallEmailIcon: ({ fill }: {
42
- fill?: string;
43
- }) => React.JSX.Element;
44
- export declare const EmailIcon: ({ fill }: {
45
- fill?: string;
46
- }) => React.JSX.Element;
47
- export declare const RedExclamation: () => React.JSX.Element;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- declare const BluxLogo: ({ fill }: {
3
- fill?: string;
4
- }) => React.JSX.Element;
5
- export default BluxLogo;
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
- export declare const AlbedoLogo: () => React.JSX.Element;
3
- export declare const HanaLogo: ({ fill }: {
4
- fill?: string;
5
- }) => React.JSX.Element;
6
- export declare const HotLogo: () => React.JSX.Element;
7
- export declare const RabetLogo: ({ fill }: {
8
- fill?: string;
9
- }) => React.JSX.Element;
10
- export declare const FreighterLogo: ({ fill }: {
11
- fill?: string;
12
- }) => React.JSX.Element;
13
- export declare const XBullLogo: ({ fill }: {
14
- fill?: string;
15
- }) => React.JSX.Element;
16
- export declare const LobstrLogo: ({ fill }: {
17
- fill?: string;
18
- }) => React.JSX.Element;
19
- export declare const StellarLogo: ({ fill }: {
20
- fill?: string;
21
- }) => React.JSX.Element;
22
- export declare const StellarSmallLogo: ({ fill }: {
23
- fill?: string;
24
- }) => React.JSX.Element;
25
- export declare const GoogleLogo: () => React.JSX.Element;
@@ -1,17 +0,0 @@
1
- import React from 'react';
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;
12
- onClick?: () => void;
13
- style?: React.CSSProperties;
14
- className?: string;
15
- }
16
- declare const Button: ({ size, variant, state, children, startIcon, endIcon, onClick, style, className, }: ButtonProps) => React.JSX.Element;
17
- export default Button;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- type CardItemProps = {
3
- variant?: 'social' | 'default' | 'input';
4
- startIcon: React.ReactNode;
5
- endArrow?: boolean;
6
- isRecent?: boolean;
7
- label?: string;
8
- onClick?: () => void;
9
- onChange?: (value: string) => void;
10
- onEnter?: (value: string) => void;
11
- onSubmit?: (value: string) => void;
12
- inputType?: 'text' | 'password' | 'number' | 'email' | string;
13
- };
14
- declare const CardItem: ({ variant, startIcon, endArrow, isRecent, label, onClick, onChange, onEnter, onSubmit, inputType, }: CardItemProps) => React.JSX.Element;
15
- export default CardItem;
@@ -1,8 +0,0 @@
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;
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- type InputFieldProps = {
3
- label?: string;
4
- placeholder?: string;
5
- error?: string;
6
- type?: 'text' | 'password' | 'number';
7
- iconRight?: React.ReactNode;
8
- iconLeft?: React.ReactNode;
9
- button?: string | React.ReactNode;
10
- onButtonClick?: () => void;
11
- value?: string;
12
- autoFocus?: boolean;
13
- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
14
- customLabel?: React.ReactNode;
15
- className?: string;
16
- };
17
- declare const InputField: ({ label, autoFocus, type, placeholder, error, iconRight, iconLeft, button, onButtonClick, customLabel, value, className, onChange, }: InputFieldProps) => React.JSX.Element;
18
- export default InputField;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- interface BackdropProps {
3
- isClosing: boolean;
4
- isSticky?: boolean;
5
- onClose: () => void;
6
- }
7
- declare const ModalBackdrop: ({ isClosing, onClose, isSticky, }: BackdropProps) => React.JSX.Element;
8
- export default ModalBackdrop;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- interface HeaderProps {
3
- icon?: 'info' | 'back';
4
- onInfo?: () => void;
5
- onBack?: () => void;
6
- title: string;
7
- closeButton?: boolean;
8
- onClose: () => void;
9
- }
10
- declare const ModalHeader: ({ icon, onInfo, onBack, title, closeButton, onClose, }: HeaderProps) => React.JSX.Element;
11
- export default ModalHeader;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- interface ModalProps {
3
- isOpen: boolean;
4
- onClose?: () => void;
5
- onBack?: () => void;
6
- children: React.ReactNode;
7
- icon?: 'info' | 'back';
8
- onInfo?: () => void;
9
- closeButton?: boolean;
10
- title: string;
11
- isSticky?: boolean;
12
- }
13
- declare const Modal: ({ isOpen, onClose, onBack, onInfo, children, title, icon, isSticky, closeButton, }: ModalProps) => React.JSX.Element | null;
14
- export default Modal;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- export type TxDetail = {
3
- hash: string;
4
- date: string;
5
- title: string;
6
- description: string;
7
- };
8
- interface TransactionProps {
9
- tx: TxDetail;
10
- }
11
- declare const _default: React.MemoExoticComponent<({ tx }: TransactionProps) => React.JSX.Element>;
12
- export default _default;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- interface SummaryProps {
3
- operationsCount: number;
4
- sender: string;
5
- receiver?: string | null;
6
- estimatedFee: string;
7
- action: string;
8
- network: string;
9
- }
10
- declare const Summary: ({ operationsCount, sender, receiver, network, estimatedFee, action, }: SummaryProps) => React.JSX.Element;
11
- export default Summary;
@@ -1,9 +0,0 @@
1
- export type IExplorerDetail = {
2
- ledgerUrl: string;
3
- accountUrl: string;
4
- operationUrl?: string;
5
- transactionUrl: string;
6
- [key: string]: string | undefined;
7
- };
8
- declare const EXPLORERS: Record<string, IExplorerDetail>;
9
- export default EXPLORERS;
@@ -1,4 +0,0 @@
1
- import { IAppearance } from '../types';
2
- export declare const ASSET_SERVER = "https://asset.rabet.io/assets";
3
- export declare const defaultLightTheme: IAppearance;
4
- export declare const defaultDarkTheme: IAppearance;
@@ -1,9 +0,0 @@
1
- export type LanguageKey = 'en' | 'es';
2
- export type Translations = {
3
- [key: string]: {
4
- [lang in LanguageKey]: string;
5
- };
6
- };
7
- export type TranslationKey = keyof typeof translations;
8
- declare const translations: Translations;
9
- export default translations;
@@ -1,8 +0,0 @@
1
- import { Url } from "../utils/network/url";
2
- export interface NetworkDetails {
3
- name: string;
4
- horizon: Url;
5
- soroban: Url;
6
- }
7
- declare const NETWORKS_DETAILS: Record<string, NetworkDetails>;
8
- export default NETWORKS_DETAILS;
@@ -1 +0,0 @@
1
- export declare const RECENT_CONNECTION_METHODS = "__BLUX__RECENT_CONNECTION_METHODS";
@@ -1,10 +0,0 @@
1
- import { Routes } from '../../types';
2
- import { LanguageKey } from '../../constants/locales';
3
- import React from 'react';
4
- type RouteContent = {
5
- title: string;
6
- isSticky?: boolean;
7
- Component: React.JSX.Element;
8
- };
9
- export declare const getModalContent: (lang: LanguageKey) => Record<Routes, RouteContent>;
10
- export {};
@@ -1,7 +0,0 @@
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 {};
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const Activity: React.FC;
3
- export default Activity;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const ConfirmCode: React.FC;
3
- export default ConfirmCode;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const OnBoarding: () => React.JSX.Element;
3
- export default OnBoarding;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const Profile: () => React.JSX.Element;
3
- export default Profile;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { IAsset } from '../../../types';
3
- type SelectAssetsProps = {
4
- assets: IAsset[];
5
- setShowSelectAssetPage: React.Dispatch<React.SetStateAction<boolean>>;
6
- setSelectedAsset: React.Dispatch<React.SetStateAction<IAsset>>;
7
- };
8
- declare const SelectAssets: ({ assets, setSelectedAsset, setShowSelectAssetPage, }: SelectAssetsProps) => React.JSX.Element;
9
- export default SelectAssets;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const SendForm: () => React.JSX.Element;
3
- export default SendForm;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const Send: () => React.JSX.Element;
3
- export default Send;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const SignTransaction: () => React.JSX.Element;
3
- export default SignTransaction;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const Successful: () => React.JSX.Element;
3
- export default Successful;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const Waiting: () => React.JSX.Element;
3
- export default Waiting;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const WrongNetwork: () => React.JSX.Element;
3
- export default WrongNetwork;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { ContextState, IProviderConfig } from '../types';
3
- export declare const ProviderContext: React.Context<ContextState | null>;
4
- type BluxProviderProps = {
5
- isDemo?: boolean;
6
- config: IProviderConfig;
7
- children: React.ReactNode | any;
8
- };
9
- export declare const BluxProvider: ({ config, isDemo, children, }: BluxProviderProps) => React.JSX.Element;
10
- export declare const useProvider: () => ContextState;
11
- export {};
@@ -1,3 +0,0 @@
1
- import { ContextInterface, Routes } from '../types';
2
- declare const useCheckWalletNetwork: (value: ContextInterface, setValue: React.Dispatch<React.SetStateAction<ContextInterface>>, setRoute: React.Dispatch<React.SetStateAction<Routes>>) => void;
3
- export default useCheckWalletNetwork;
@@ -1,2 +0,0 @@
1
- declare const useCheckProvider: () => import("../types").ContextState;
2
- export default useCheckProvider;
@@ -1,7 +0,0 @@
1
- import { Horizon, rpc } from "@stellar/stellar-sdk";
2
- declare const useCustomNetwork: (network?: string) => {
3
- soroban: rpc.Server;
4
- horizon: Horizon.Server;
5
- networkPassphrase: string;
6
- };
7
- export default useCustomNetwork;
@@ -1,2 +0,0 @@
1
- import { TranslationKey } from '../constants/locales';
2
- export declare const useLang: () => (key: TranslationKey, vars?: Record<string, string>) => string;
@@ -1,7 +0,0 @@
1
- export declare const useModalAnimation: (isOpen: boolean) => {
2
- setHasTransition: (value: boolean) => void;
3
- handleClose: (onClose: () => void) => void;
4
- isOpening: boolean;
5
- isClosing: boolean;
6
- hasTransition: boolean;
7
- };
@@ -1,8 +0,0 @@
1
- import { Networks } from '@stellar/stellar-sdk';
2
- export declare const networks: {
3
- mainnet: Networks;
4
- testnet: Networks;
5
- sandbox: Networks;
6
- futurenet: Networks;
7
- standalone: Networks;
8
- };