@bluxcc/react 0.1.4 → 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.
@@ -1,7 +1,7 @@
1
1
  import { Horizon } from '@stellar/stellar-sdk';
2
+ import { HorizonApi } from '@stellar/stellar-sdk/lib/horizon';
2
3
  import { Url } from '../utils/network/url';
3
4
  import { Fallback } from '../utils/network/fallback';
4
- import { History } from '../utils/stellar/getTransactions';
5
5
  /**
6
6
  * Enum representing the supported wallets in the system.
7
7
  */
@@ -29,7 +29,7 @@ export interface AccountData {
29
29
  subentry_count: number;
30
30
  balances: Horizon.HorizonApi.BalanceLine[];
31
31
  thresholds: Horizon.HorizonApi.AccountThresholds;
32
- transactions?: History[];
32
+ transactions?: Horizon.ServerApi.TransactionRecord[];
33
33
  }
34
34
  interface IServers {
35
35
  horizon?: Url | Fallback;
@@ -37,15 +37,22 @@ interface IServers {
37
37
  }
38
38
  export type ITransports = Record<string, IServers>;
39
39
  /**
40
- * Configuration options for the provider.
40
+ * BluxProvider.config
41
41
  */
42
42
  export interface IProviderConfig {
43
43
  appName: string;
44
44
  networks: string[];
45
- appearance: IAppearance;
45
+ appearance?: Partial<IAppearance>;
46
46
  transports?: ITransports;
47
47
  loginMethods?: Array<'wallet' | 'email' | 'sms' | 'google' | 'twitter' | 'discord' | 'github' | 'passkey'>;
48
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
+ }
49
56
  /**
50
57
  * Information about the connected wallet.
51
58
  */
@@ -87,15 +94,15 @@ export interface IAppearance {
87
94
  background: string;
88
95
  accent: string;
89
96
  textColor: string;
90
- font: SupportedFonts;
91
- cornerRadius: CornerRadius;
97
+ font: SupportedFonts | string;
98
+ cornerRadius: CornerRadius | string;
92
99
  logo?: React.ImgHTMLAttributes<HTMLImageElement>['src'];
93
100
  }
94
101
  /**
95
102
  * Structure of the global context values.
96
103
  */
97
104
  export interface ContextInterface {
98
- config: IProviderConfig;
105
+ config: IConfig;
99
106
  user: IUser;
100
107
  isModalOpen: boolean;
101
108
  isReady: boolean;
@@ -105,8 +112,8 @@ export interface ContextInterface {
105
112
  waitingStatus: 'connecting' | 'signing';
106
113
  signTransaction: {
107
114
  xdr: string;
108
- resolver: ((value: Horizon.HorizonApi.SubmitTransactionResponse) => void) | null;
109
- result: Horizon.HorizonApi.SubmitTransactionResponse | null;
115
+ resolver: ((value: HorizonApi.SubmitTransactionResponse) => void) | null;
116
+ result: HorizonApi.SubmitTransactionResponse | null;
110
117
  };
111
118
  }
112
119
  /**
@@ -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;
@@ -3,5 +3,5 @@ declare const getTransactionDetails: (xdr: string) => {
3
3
  operations: number;
4
4
  sender: string;
5
5
  estimatedFee: number;
6
- };
6
+ } | null;
7
7
  export default getTransactionDetails;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bluxcc/react",
3
3
  "author": "Blux team",
4
- "version": "0.1.4",
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>;