@bluxcc/core 0.1.9 → 0.1.10

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 (112) hide show
  1. package/dist/assets/Icons.d.ts +107 -0
  2. package/dist/assets/Logos.d.ts +30 -0
  3. package/dist/assets/bluxLogo.d.ts +8 -0
  4. package/dist/components/Alert/index.d.ts +9 -0
  5. package/dist/components/AssetsList/index.d.ts +6 -0
  6. package/dist/components/Button/index.d.ts +19 -0
  7. package/dist/components/CardItem/index.d.ts +16 -0
  8. package/dist/components/Divider/index.d.ts +2 -0
  9. package/dist/components/Header/index.d.ts +10 -0
  10. package/dist/components/Input/OTPInput.d.ts +8 -0
  11. package/dist/components/Input/index.d.ts +19 -0
  12. package/dist/components/Modal/index.d.ts +11 -0
  13. package/dist/components/Provider.d.ts +1 -0
  14. package/dist/components/QRCode/index.d.ts +11 -0
  15. package/dist/components/TabBox/index.d.ts +12 -0
  16. package/dist/components/Transaction/History/index.d.ts +12 -0
  17. package/dist/components/Transaction/Summary/index.d.ts +10 -0
  18. package/dist/constants/assets.d.ts +18 -0
  19. package/dist/constants/consts.d.ts +4 -0
  20. package/dist/constants/explorers.d.ts +9 -0
  21. package/dist/constants/locales.d.ts +9 -0
  22. package/dist/constants/networkDetails.d.ts +14 -0
  23. package/dist/constants/routes.d.ts +7 -0
  24. package/dist/constants/themes.d.ts +3 -0
  25. package/dist/enums.d.ts +39 -0
  26. package/dist/exports/blux.d.ts +21 -0
  27. package/dist/exports/core/callBuilder.d.ts +59 -0
  28. package/dist/exports/core/getAccount.d.ts +7 -0
  29. package/dist/exports/core/getAccounts.d.ts +14 -0
  30. package/dist/exports/core/getAssets.d.ts +12 -0
  31. package/dist/exports/core/getBalances.d.ts +8 -0
  32. package/dist/exports/core/getClaimableBalances.d.ts +13 -0
  33. package/dist/exports/core/getEffects.d.ts +15 -0
  34. package/dist/exports/core/getLedgers.d.ts +11 -0
  35. package/dist/exports/core/getLiquidityPools.d.ts +12 -0
  36. package/dist/exports/core/getNetwork.d.ts +1 -0
  37. package/dist/exports/core/getOffers.d.ts +15 -0
  38. package/dist/exports/core/getOperations.d.ts +16 -0
  39. package/dist/exports/core/getOrderbook.d.ts +8 -0
  40. package/dist/exports/core/getPayments.d.ts +11 -0
  41. package/dist/exports/core/getStrictReceivePaths.d.ts +8 -0
  42. package/dist/exports/core/getStrictSendPaths.d.ts +8 -0
  43. package/dist/exports/core/getTradeAggregation.d.ts +4 -0
  44. package/dist/exports/core/getTrades.d.ts +15 -0
  45. package/dist/exports/core/getTransactions.d.ts +15 -0
  46. package/dist/exports/core/index.d.ts +20 -0
  47. package/dist/exports/core/networks.d.ts +8 -0
  48. package/dist/exports/core/switchNetwork.d.ts +1 -0
  49. package/dist/exports/createConfig.d.ts +3 -0
  50. package/dist/exports/exportedStore.d.ts +15 -0
  51. package/dist/exports/index.d.ts +3 -0
  52. package/dist/exports/utils.d.ts +14 -0
  53. package/dist/hooks/useBalances.d.ts +8 -0
  54. package/dist/hooks/useCheckWalletNetwork.d.ts +3 -0
  55. package/dist/hooks/useDynamicHeight.d.ts +5 -0
  56. package/dist/hooks/useIsMobile.d.ts +1 -0
  57. package/dist/hooks/useLang.d.ts +2 -0
  58. package/dist/hooks/useLockBodyScroll.d.ts +1 -0
  59. package/dist/hooks/useModalAnimation.d.ts +5 -0
  60. package/dist/hooks/useTransactions.d.ts +11 -0
  61. package/dist/hooks/useUpdateAccount.d.ts +2 -0
  62. package/dist/index.cjs.js +27 -0
  63. package/dist/index.d.ts +2 -0
  64. package/dist/index.esm.js +27 -0
  65. package/dist/index.iife.js +35 -0
  66. package/dist/pages/About/index.d.ts +2 -0
  67. package/dist/pages/Failed/index.d.ts +2 -0
  68. package/dist/pages/Onboarding/OTP/index.d.ts +2 -0
  69. package/dist/pages/Onboarding/index.d.ts +2 -0
  70. package/dist/pages/Profile/Activity/index.d.ts +2 -0
  71. package/dist/pages/Profile/Balances/AddToken/index.d.ts +2 -0
  72. package/dist/pages/Profile/Balances/BalanceDetails/index.d.ts +2 -0
  73. package/dist/pages/Profile/Balances/index.d.ts +2 -0
  74. package/dist/pages/Profile/Receive/index.d.ts +2 -0
  75. package/dist/pages/Profile/SelectAsset/index.d.ts +2 -0
  76. package/dist/pages/Profile/Send/index.d.ts +2 -0
  77. package/dist/pages/Profile/Swap/AssetBox/index.d.ts +7 -0
  78. package/dist/pages/Profile/Swap/index.d.ts +2 -0
  79. package/dist/pages/Profile/index.d.ts +2 -0
  80. package/dist/pages/SendTransaction/index.d.ts +2 -0
  81. package/dist/pages/SignMessage/index.d.ts +2 -0
  82. package/dist/pages/Successful/index.d.ts +2 -0
  83. package/dist/pages/Waiting/index.d.ts +2 -0
  84. package/dist/pages/WalletConnect/index.d.ts +2 -0
  85. package/dist/pages/WrongNetwork/index.d.ts +2 -0
  86. package/dist/stellar/getTransactionDetails.d.ts +8 -0
  87. package/dist/stellar/handleSignMessage.d.ts +3 -0
  88. package/dist/stellar/handleTransactionSigning.d.ts +3 -0
  89. package/dist/stellar/paymentTransaction.d.ts +4 -0
  90. package/dist/stellar/processes/connectWalletProcess.d.ts +4 -0
  91. package/dist/stellar/processes/sendTransactionProcess.d.ts +3 -0
  92. package/dist/stellar/processes/signMessageProcess.d.ts +3 -0
  93. package/dist/stellar/signTransaction.d.ts +3 -0
  94. package/dist/stellar/submitTransaction.d.ts +5 -0
  95. package/dist/stellar/swapTransaction.d.ts +4 -0
  96. package/dist/store.d.ts +87 -0
  97. package/dist/types.d.ts +114 -0
  98. package/dist/utils/animatedGradient.d.ts +18 -0
  99. package/dist/utils/helpers.d.ts +40 -0
  100. package/dist/utils/initializeWalletConnect.d.ts +7 -0
  101. package/dist/utils/walletLogos.d.ts +2 -0
  102. package/dist/wallets/albedo.d.ts +2 -0
  103. package/dist/wallets/freighter.d.ts +2 -0
  104. package/dist/wallets/hana.d.ts +2 -0
  105. package/dist/wallets/hot.d.ts +2 -0
  106. package/dist/wallets/index.d.ts +3 -0
  107. package/dist/wallets/klever.d.ts +2 -0
  108. package/dist/wallets/lobstr.d.ts +2 -0
  109. package/dist/wallets/rabet.d.ts +2 -0
  110. package/dist/wallets/walletConnect.d.ts +2 -0
  111. package/dist/wallets/xbull.d.ts +2 -0
  112. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ import { Horizon } from '@stellar/stellar-sdk';
2
+ import { OperationCallBuilder } from '@stellar/stellar-sdk/lib/horizon/operation_call_builder';
3
+ import { CallBuilderOptions } from '../utils';
4
+ export type GetOperationsOptions = CallBuilderOptions & {
5
+ forAccount?: string;
6
+ forClaimableBalance?: string;
7
+ forLedger?: string | number;
8
+ forTransaction?: string;
9
+ forLiquidityPool?: string;
10
+ includeFailed?: boolean;
11
+ };
12
+ export type GetOperationsResult = {
13
+ builder: OperationCallBuilder;
14
+ response: Horizon.ServerApi.CollectionPage<Horizon.ServerApi.OperationRecord>;
15
+ };
16
+ export declare const getOperations: (options: GetOperationsOptions) => Promise<GetOperationsResult>;
@@ -0,0 +1,8 @@
1
+ import { Asset, Horizon } from '@stellar/stellar-sdk';
2
+ import { OrderbookCallBuilder } from '@stellar/stellar-sdk/lib/horizon/orderbook_call_builder';
3
+ import { CallBuilderOptions } from '../utils';
4
+ export type GetOrderbookResult = {
5
+ builder: OrderbookCallBuilder;
6
+ response: Horizon.ServerApi.OrderbookRecord;
7
+ };
8
+ export declare const getOrderbook: (args: [selling: Asset, buying: Asset], options: CallBuilderOptions) => Promise<GetOrderbookResult>;
@@ -0,0 +1,11 @@
1
+ import { CallBuilderOptions } from '../utils';
2
+ export type GetPaymentsOptions = CallBuilderOptions & {
3
+ forAccount?: string;
4
+ forLedger?: string | number;
5
+ forTransaction?: string;
6
+ includeFailed?: boolean;
7
+ };
8
+ export declare const getPayments: (options: GetPaymentsOptions) => Promise<{
9
+ builder: import("@stellar/stellar-sdk/lib/horizon/payment_call_builder").PaymentCallBuilder;
10
+ response: import("@stellar/stellar-sdk/lib/horizon").ServerApi.CollectionPage<import("@stellar/stellar-sdk/lib/horizon").ServerApi.CreateAccountOperationRecord | import("@stellar/stellar-sdk/lib/horizon").ServerApi.PaymentOperationRecord | import("@stellar/stellar-sdk/lib/horizon").ServerApi.PathPaymentOperationRecord | import("@stellar/stellar-sdk/lib/horizon").ServerApi.AccountMergeOperationRecord | import("@stellar/stellar-sdk/lib/horizon").ServerApi.PathPaymentStrictSendOperationRecord | import("@stellar/stellar-sdk/lib/horizon").ServerApi.InvokeHostFunctionOperationRecord>;
11
+ }>;
@@ -0,0 +1,8 @@
1
+ import { Asset, Horizon } from '@stellar/stellar-sdk';
2
+ import { PathCallBuilder } from '@stellar/stellar-sdk/lib/horizon/path_call_builder';
3
+ import { CallBuilderOptions } from '../utils';
4
+ export type GetPaymentPathResult = {
5
+ builder: PathCallBuilder;
6
+ response: Horizon.ServerApi.CollectionPage<Horizon.ServerApi.PaymentPathRecord>;
7
+ };
8
+ export declare const getStrictReceivePaths: (args: [source: string | Asset[], destinationAsset: Asset, destinationAmount: string], options: CallBuilderOptions) => Promise<GetPaymentPathResult>;
@@ -0,0 +1,8 @@
1
+ import { Asset, Horizon } from '@stellar/stellar-sdk';
2
+ import { PathCallBuilder } from '@stellar/stellar-sdk/lib/horizon/path_call_builder';
3
+ import { CallBuilderOptions } from '../utils';
4
+ export type GetPaymentPathResult = {
5
+ builder: PathCallBuilder;
6
+ response: Horizon.ServerApi.CollectionPage<Horizon.ServerApi.PaymentPathRecord>;
7
+ };
8
+ export declare const getStrictSendPaths: (args: [sourceAsset: Asset, sourceAmount: string, destination: string | Asset[]], options: CallBuilderOptions) => Promise<GetPaymentPathResult>;
@@ -0,0 +1,4 @@
1
+ import { Asset } from '@stellar/stellar-sdk';
2
+ import { CallBuilderOptions } from '../utils';
3
+ export type GetTradeAggregationResult = any;
4
+ export declare const getTradeAggregation: (args: [base: Asset, counter: Asset, start_time: number, end_time: number, resolution: number, offset: number], options: CallBuilderOptions) => Promise<GetTradeAggregationResult>;
@@ -0,0 +1,15 @@
1
+ import { Asset, Horizon } from '@stellar/stellar-sdk';
2
+ import { TradesCallBuilder } from '@stellar/stellar-sdk/lib/horizon/trades_call_builder';
3
+ import { CallBuilderOptions } from '../utils';
4
+ export type GetTradesOptions = CallBuilderOptions & {
5
+ forAssetPair?: [base: Asset, counter: Asset];
6
+ forOffer?: string;
7
+ forType?: Horizon.ServerApi.TradeType;
8
+ forAccount?: string;
9
+ forLiquidityPool?: string;
10
+ };
11
+ export type GetTradesResult = {
12
+ builder: TradesCallBuilder;
13
+ response: Horizon.ServerApi.CollectionPage<Horizon.ServerApi.TradeRecord>;
14
+ };
15
+ export declare const getTrades: (options: GetTradesOptions) => Promise<GetTradesResult>;
@@ -0,0 +1,15 @@
1
+ import { Horizon } from '@stellar/stellar-sdk';
2
+ import { TransactionCallBuilder } from '@stellar/stellar-sdk/lib/horizon/transaction_call_builder';
3
+ import { CallBuilderOptions } from '../utils';
4
+ export type GetTransactionsOptions = CallBuilderOptions & {
5
+ forAccount?: string;
6
+ forClaimableBalance?: string;
7
+ forLedger?: string | number;
8
+ forLiquidityPool?: string;
9
+ includeFailed?: boolean;
10
+ };
11
+ export type GetTransactionsResult = {
12
+ builder: TransactionCallBuilder;
13
+ response: Horizon.ServerApi.CollectionPage<Horizon.ServerApi.TransactionRecord>;
14
+ };
15
+ export declare const getTransactions: (options: GetTransactionsOptions) => Promise<GetTransactionsResult>;
@@ -0,0 +1,20 @@
1
+ export { getAccount } from './getAccount';
2
+ export { getAccounts } from './getAccounts';
3
+ export { getAssets } from './getAssets';
4
+ export { getBalances } from './getBalances';
5
+ export { getClaimableBalances } from './getClaimableBalances';
6
+ export { getEffects } from './getEffects';
7
+ export { getLedgers } from './getLedgers';
8
+ export { getLiquidityPools } from './getLiquidityPools';
9
+ export { getNetwork } from './getNetwork';
10
+ export { getOffers } from './getOffers';
11
+ export { getOperations } from './getOperations';
12
+ export { getOrderbook } from './getOrderbook';
13
+ export { getPayments } from './getPayments';
14
+ export { getStrictReceivePaths } from './getStrictReceivePaths';
15
+ export { getStrictSendPaths } from './getStrictSendPaths';
16
+ export { getTradeAggregation } from './getTradeAggregation';
17
+ export { getTrades } from './getTrades';
18
+ export { getTransactions } from './getTransactions';
19
+ export { networks } from './networks';
20
+ export { switchNetwork } from './switchNetwork';
@@ -0,0 +1,8 @@
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
+ };
@@ -0,0 +1 @@
1
+ export declare const switchNetwork: (newNetwork: string) => void;
@@ -0,0 +1,3 @@
1
+ import { IConfig } from '../types';
2
+ import '../tailwind.css';
3
+ export declare function createConfig(config: IConfig): void;
@@ -0,0 +1,15 @@
1
+ import { IInternalConfig } from '../types';
2
+ import { IStellarConfig, IUser, store } from '../store';
3
+ export interface IExportedStore {
4
+ config: IInternalConfig;
5
+ user?: IUser;
6
+ authState: {
7
+ isReady: boolean;
8
+ isAuthenticated: boolean;
9
+ };
10
+ stellar?: IStellarConfig;
11
+ }
12
+ export declare const exportedStore: import("zustand").StoreApi<IExportedStore>;
13
+ export declare const syncExportedStore: (mainStore: typeof store) => () => void;
14
+ export declare const useExportedStore: <T>(selector: (state: IExportedStore) => T) => T;
15
+ export declare const getState: () => IExportedStore, subscribe: (listener: (state: IExportedStore, prevState: IExportedStore) => void) => () => void, getInitialState: () => IExportedStore;
@@ -0,0 +1,3 @@
1
+ export * from './core';
2
+ export { blux } from './blux';
3
+ export { getState, subscribe, getInitialState, useExportedStore, } from './exportedStore';
@@ -0,0 +1,14 @@
1
+ import { Horizon, rpc } from '@stellar/stellar-sdk';
2
+ export type CallBuilderOptions = {
3
+ cursor?: string;
4
+ limit?: number;
5
+ network?: string;
6
+ order?: 'asc' | 'desc';
7
+ };
8
+ export declare const checkConfigCreated: () => boolean;
9
+ export declare const getAddress: (address?: string) => string;
10
+ export declare const getNetwork: (network?: string) => {
11
+ horizon: Horizon.Server;
12
+ soroban: rpc.Server;
13
+ networkPassphrase: string;
14
+ };
@@ -0,0 +1,8 @@
1
+ import { Horizon } from '@stellar/stellar-sdk';
2
+ export type UseBalancesResult = {
3
+ loading: boolean;
4
+ error: Error | null;
5
+ balances: Horizon.HorizonApi.BalanceLine[];
6
+ };
7
+ declare const useBalances: () => UseBalancesResult;
8
+ export default useBalances;
@@ -0,0 +1,3 @@
1
+ import { IStore } from '../store';
2
+ declare const useCheckWalletNetwork: (store: IStore) => void;
3
+ export default useCheckWalletNetwork;
@@ -0,0 +1,5 @@
1
+ export declare const useDynamicHeight: (ref: React.RefObject<HTMLDivElement | null>, deps?: React.DependencyList) => {
2
+ height: string | number;
3
+ isHeightReady: boolean;
4
+ reset: () => void;
5
+ };
@@ -0,0 +1 @@
1
+ export declare const useIsMobile: (breakpoint?: number) => boolean;
@@ -0,0 +1,2 @@
1
+ import { TranslationKey } from "../constants/locales";
2
+ export declare const useLang: () => (key: TranslationKey, vars?: Record<string, string>) => string;
@@ -0,0 +1 @@
1
+ export declare function useLockBodyScroll(lock: boolean): void;
@@ -0,0 +1,5 @@
1
+ export declare const useModalAnimation: (isOpen: boolean, duration?: number) => {
2
+ handleClose: (onClose: () => void) => () => void;
3
+ isOpening: boolean;
4
+ isClosing: boolean;
5
+ };
@@ -0,0 +1,11 @@
1
+ import { Horizon } from '@stellar/stellar-sdk';
2
+ interface TransactionRecordWithOperations extends Omit<Horizon.ServerApi.TransactionRecord, 'operations'> {
3
+ operations: Horizon.ServerApi.OperationRecord[];
4
+ }
5
+ export type UseTransactionsResult = {
6
+ loading: boolean;
7
+ error: Error | null;
8
+ transactions: TransactionRecordWithOperations[];
9
+ };
10
+ declare const useTransactions: () => UseTransactionsResult;
11
+ export default useTransactions;
@@ -0,0 +1,2 @@
1
+ declare const useUpdateAccount: () => void;
2
+ export default useUpdateAccount;