@bluxcc/react 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.
Files changed (37) hide show
  1. package/README.md +6 -6
  2. package/dist/assets/Icons.d.ts +29 -9
  3. package/dist/components/Input/index.d.ts +3 -3
  4. package/dist/context/provider.d.ts +4 -2
  5. package/dist/hooks/useBlux.d.ts +4 -4
  6. package/dist/index.cjs.js +1 -1
  7. package/dist/index.cjs.js.map +1 -1
  8. package/dist/index.d.ts +2 -0
  9. package/dist/index.esm.js +1 -1
  10. package/dist/index.esm.js.map +1 -1
  11. package/dist/types/index.d.ts +19 -11
  12. package/dist/utils/getBorderRadius.d.ts +1 -1
  13. package/dist/utils/getWalletNetwork.d.ts +3 -0
  14. package/dist/utils/network/fallback.d.ts +13 -0
  15. package/dist/utils/network/url.d.ts +12 -0
  16. package/dist/utils/stellar/getTransactionDetails.d.ts +2 -2
  17. package/dist/utils/stellar/getTransactions.d.ts +7 -0
  18. package/package.json +1 -1
  19. package/dist/chains.d.ts +0 -8
  20. package/dist/components/Button/buttonVariants.d.ts +0 -9
  21. package/dist/containers/ConnectModal/content.d.ts +0 -11
  22. package/dist/containers/ConnectModal/index.d.ts +0 -7
  23. package/dist/containers/ModalState/Connecting/index.d.ts +0 -3
  24. package/dist/containers/ModalState/OnBoarding/index.d.ts +0 -7
  25. package/dist/containers/ModalState/Profile/index.d.ts +0 -3
  26. package/dist/hooks/useConnectModal.d.ts +0 -12
  27. package/dist/hooks/useGoogleFont.d.ts +0 -2
  28. package/dist/utils/BN.d.ts +0 -3
  29. package/dist/utils/getHorizonServer.d.ts +0 -6
  30. package/dist/utils/getInitialHeight.d.ts +0 -2
  31. package/dist/utils/getNetworkByPassphrase.d.ts +0 -1
  32. package/dist/utils/getNetworkPassphrase.d.ts +0 -1
  33. package/dist/utils/getTransactionDetails.d.ts +0 -6
  34. package/dist/utils/handleIcons.d.ts +0 -3
  35. package/dist/utils/setWalletNetwork.d.ts +0 -3
  36. package/dist/utils/signTransactionHandler.d.ts +0 -3
  37. package/dist/utils/submitTransaction.d.ts +0 -2
@@ -1,5 +1,7 @@
1
1
  import { Horizon } from '@stellar/stellar-sdk';
2
2
  import { HorizonApi } from '@stellar/stellar-sdk/lib/horizon';
3
+ import { Url } from '../utils/network/url';
4
+ import { Fallback } from '../utils/network/fallback';
3
5
  /**
4
6
  * Enum representing the supported wallets in the system.
5
7
  */
@@ -23,28 +25,34 @@ export declare enum WalletNetwork {
23
25
  export interface AccountData {
24
26
  id: string;
25
27
  sequence: string;
28
+ xlmBalance: string;
26
29
  subentry_count: number;
27
- thresholds: Horizon.HorizonApi.AccountThresholds;
28
30
  balances: Horizon.HorizonApi.BalanceLine[];
29
- xlmBalance: string;
31
+ thresholds: Horizon.HorizonApi.AccountThresholds;
30
32
  transactions?: Horizon.ServerApi.TransactionRecord[];
31
33
  }
32
34
  interface IServers {
33
- horizon?: string;
34
- soroban?: string;
35
+ horizon?: Url | Fallback;
36
+ soroban?: Url | Fallback;
35
37
  }
36
38
  export type ITransports = Record<string, IServers>;
37
39
  /**
38
- * Configuration options for the provider.
40
+ * BluxProvider.config
39
41
  */
40
42
  export interface IProviderConfig {
41
43
  appName: string;
42
- appLogo?: string;
43
44
  networks: string[];
44
- appearance: IAppearance;
45
+ appearance?: Partial<IAppearance>;
45
46
  transports?: ITransports;
46
47
  loginMethods?: Array<'wallet' | 'email' | 'sms' | 'google' | 'twitter' | 'discord' | 'github' | 'passkey'>;
47
48
  }
49
+ /**
50
+ * context.value.config
51
+ * Appearance will be set to default values if the user does not provider appearance (or provides some of the values in Appearance)
52
+ */
53
+ export interface IConfig extends IProviderConfig {
54
+ appearance: IAppearance;
55
+ }
48
56
  /**
49
57
  * Information about the connected wallet.
50
58
  */
@@ -86,15 +94,15 @@ export interface IAppearance {
86
94
  background: string;
87
95
  accent: string;
88
96
  textColor: string;
89
- font: SupportedFonts;
90
- cornerRadius: CornerRadius;
91
- cover: string;
97
+ font: SupportedFonts | string;
98
+ cornerRadius: CornerRadius | string;
99
+ logo?: React.ImgHTMLAttributes<HTMLImageElement>['src'];
92
100
  }
93
101
  /**
94
102
  * Structure of the global context values.
95
103
  */
96
104
  export interface ContextInterface {
97
- config: IProviderConfig;
105
+ config: IConfig;
98
106
  user: IUser;
99
107
  isModalOpen: boolean;
100
108
  isReady: boolean;
@@ -1,3 +1,3 @@
1
1
  import { CornerRadius } from '../types';
2
- declare const getBorderRadius: (cornerRadius: CornerRadius) => string;
2
+ declare const getBorderRadius: (cornerRadius: CornerRadius | string) => string;
3
3
  export default getBorderRadius;
@@ -0,0 +1,3 @@
1
+ import { WalletInterface } from '../types';
2
+ declare const getWalletNetwork: (wallet: WalletInterface, networks: string[]) => Promise<string>;
3
+ export default getWalletNetwork;
@@ -0,0 +1,13 @@
1
+ import { Url } from './url';
2
+ export interface FallbackOptions {
3
+ retryCount?: number;
4
+ retryDelay?: number;
5
+ }
6
+ export interface Fallback extends FallbackOptions {
7
+ urls: Url[];
8
+ }
9
+ export declare const fallback: (urls: Url[], options?: FallbackOptions) => {
10
+ retryCount?: number;
11
+ retryDelay?: number;
12
+ urls: Url[];
13
+ };
@@ -0,0 +1,12 @@
1
+ export interface UrlOptions {
2
+ allowHttp?: boolean;
3
+ appName?: string;
4
+ appVersion?: string;
5
+ authToken?: string;
6
+ retryCount?: number;
7
+ retryDelay?: number;
8
+ }
9
+ export interface Url extends UrlOptions {
10
+ url: string;
11
+ }
12
+ export declare const url: (urlStr: string, options?: UrlOptions) => Url;
@@ -1,7 +1,7 @@
1
1
  declare const getTransactionDetails: (xdr: string) => {
2
- action: "createAccount" | "payment" | "pathPaymentStrictReceive" | "pathPaymentStrictSend" | "createPassiveSellOffer" | "manageSellOffer" | "manageBuyOffer" | "setOptions" | "changeTrust" | "allowTrust" | "accountMerge" | "inflation" | "manageData" | "bumpSequence" | "createClaimableBalance" | "claimClaimableBalance" | "beginSponsoringFutureReserves" | "endSponsoringFutureReserves" | "revokeSponsorship" | "clawback" | "clawbackClaimableBalance" | "setTrustLineFlags" | "liquidityPoolDeposit" | "liquidityPoolWithdraw" | "invokeHostFunction" | "extendFootprintTtl" | "restoreFootprint";
2
+ action: "payment" | "createAccount" | "pathPaymentStrictReceive" | "pathPaymentStrictSend" | "createPassiveSellOffer" | "manageSellOffer" | "manageBuyOffer" | "setOptions" | "changeTrust" | "allowTrust" | "accountMerge" | "inflation" | "manageData" | "bumpSequence" | "createClaimableBalance" | "claimClaimableBalance" | "beginSponsoringFutureReserves" | "endSponsoringFutureReserves" | "revokeSponsorship" | "clawback" | "clawbackClaimableBalance" | "setTrustLineFlags" | "liquidityPoolDeposit" | "liquidityPoolWithdraw" | "invokeHostFunction" | "extendFootprintTtl" | "restoreFootprint";
3
3
  operations: number;
4
4
  sender: string;
5
5
  estimatedFee: number;
6
- };
6
+ } | null;
7
7
  export default getTransactionDetails;
@@ -0,0 +1,7 @@
1
+ import { Horizon } from '@stellar/stellar-sdk';
2
+ export type History = {
3
+ title: string;
4
+ description: string;
5
+ others?: any;
6
+ };
7
+ export declare const getTransactions: (server: Horizon.Server, publicKey: string) => Promise<History[]>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bluxcc/react",
3
3
  "author": "Blux team",
4
- "version": "0.1.3",
4
+ "version": "0.1.5",
5
5
  "homepage": "https://blux.cc",
6
6
  "description": "Connecting to the Stellar Ecosystem and Beyond",
7
7
  "repository": {
package/dist/chains.d.ts DELETED
@@ -1,8 +0,0 @@
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,9 +0,0 @@
1
- import React from 'react';
2
- import { ButtonProps } from './index';
3
- interface IconButtonProps extends ButtonProps {
4
- icon: React.ReactNode;
5
- name: string;
6
- }
7
- export declare const ButtonWithIcon: ({ icon, name, ...props }: IconButtonProps) => React.JSX.Element;
8
- export declare const ButtonWithIconAndArrow: ({ icon, name, ...props }: IconButtonProps) => React.JSX.Element;
9
- export {};
@@ -1,11 +0,0 @@
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,7 +0,0 @@
1
- import React from 'react';
2
- interface ConnectModalProps {
3
- isOpen: boolean;
4
- closeModal: () => void;
5
- }
6
- export default function ConnectModal({ isOpen, closeModal }: ConnectModalProps): React.JSX.Element;
7
- export {};
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const Connecting: () => React.JSX.Element;
3
- export default Connecting;
@@ -1,7 +0,0 @@
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,3 +0,0 @@
1
- import React from 'react';
2
- declare const Profile: () => React.JSX.Element;
3
- export default Profile;
@@ -1,12 +0,0 @@
1
- import { ModalState } from '../types';
2
- export interface UseConnectModalReturn {
3
- modalState: ModalState;
4
- handleGoBack: () => void;
5
- setShowAllWallets: (show: boolean) => void;
6
- closeModal: () => void;
7
- modalHeader: string;
8
- showBackButton: boolean;
9
- showCloseButton: boolean;
10
- initialHeight: number;
11
- }
12
- export declare const useConnectModal: () => UseConnectModalReturn;
@@ -1,2 +0,0 @@
1
- import { SupportedFonts } from '../types';
2
- export declare function useGoogleFonts(): SupportedFonts;
@@ -1,3 +0,0 @@
1
- import BigNumber from 'bignumber.js';
2
- declare const BN: typeof BigNumber;
3
- export default BN;
@@ -1,6 +0,0 @@
1
- import { HORIZON_SERVERS } from '../constants';
2
- import { Horizon } from '@stellar/stellar-sdk';
3
- type HorizonServer = Horizon.Server;
4
- type NetworkKey = keyof typeof HORIZON_SERVERS;
5
- export declare const getHorizonServer: (network: NetworkKey) => HorizonServer;
6
- export {};
@@ -1,2 +0,0 @@
1
- import { Routes } from '../types';
2
- export declare const getInitialHeight: (route: Routes) => number;
@@ -1 +0,0 @@
1
- export declare const getNetworkByPassphrase: (passphrase: string) => string;
@@ -1 +0,0 @@
1
- export declare const getNetworkPassphrase: (network: string) => string;
@@ -1,6 +0,0 @@
1
- export declare const getTransactionDetails: (xdr: string, networkPassPhrase: string) => {
2
- action: "createAccount" | "payment" | "pathPaymentStrictReceive" | "pathPaymentStrictSend" | "createPassiveSellOffer" | "manageSellOffer" | "manageBuyOffer" | "setOptions" | "changeTrust" | "allowTrust" | "accountMerge" | "inflation" | "manageData" | "bumpSequence" | "createClaimableBalance" | "claimClaimableBalance" | "beginSponsoringFutureReserves" | "endSponsoringFutureReserves" | "revokeSponsorship" | "clawback" | "clawbackClaimableBalance" | "setTrustLineFlags" | "liquidityPoolDeposit" | "liquidityPoolWithdraw" | "invokeHostFunction" | "extendFootprintTtl" | "restoreFootprint";
3
- operations: number;
4
- sender: string;
5
- estimatedFee: number;
6
- };
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const handleIcons: (walletName: string) => React.JSX.Element | null;
3
- export default handleIcons;
@@ -1,3 +0,0 @@
1
- import { WalletInterface } from "../types";
2
- declare const setWalletNetwork: (wallet: WalletInterface, networks: string[]) => Promise<string>;
3
- export default setWalletNetwork;
@@ -1,3 +0,0 @@
1
- import { HorizonApi } from '@stellar/stellar-sdk/lib/horizon';
2
- import { WalletActions } from '../types';
3
- export declare const signTransactionHandler: (wallet: WalletActions, xdr: string, address: string, networkPassphrase: string, resolver: ((value: HorizonApi.SubmitTransactionResponse) => void) | null) => Promise<HorizonApi.SubmitTransactionResponse>;
@@ -1,2 +0,0 @@
1
- import { Horizon } from '@stellar/stellar-sdk';
2
- export declare const submitTransaction: (xdr: string, networkPassPhrase: string) => Promise<Horizon.HorizonApi.SubmitTransactionResponse>;