@bluxcc/core 0.1.3 → 0.1.4

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 (47) hide show
  1. package/dist/assets/Icons.d.ts +6 -0
  2. package/dist/assets/Logos.d.ts +2 -0
  3. package/dist/components/AssetsList/index.d.ts +1 -1
  4. package/dist/components/Button/index.d.ts +7 -5
  5. package/dist/components/CardItem/index.d.ts +4 -4
  6. package/dist/components/Header/index.d.ts +1 -1
  7. package/dist/components/Input/index.d.ts +4 -3
  8. package/dist/components/Modal/index.d.ts +2 -2
  9. package/dist/components/TabBox/index.d.ts +1 -1
  10. package/dist/constants/assets.d.ts +18 -0
  11. package/dist/constants/locales.d.ts +1 -1
  12. package/dist/constants/routes.d.ts +2 -2
  13. package/dist/enums.d.ts +2 -1
  14. package/dist/exports/core/getBalances.d.ts +1 -1
  15. package/dist/exports/utils.d.ts +2 -2
  16. package/dist/hooks/useBalances.d.ts +1 -1
  17. package/dist/hooks/useCheckWalletNetwork.d.ts +3 -0
  18. package/dist/hooks/useDynamicHeight.d.ts +2 -1
  19. package/dist/hooks/useLockBodyScroll.d.ts +1 -0
  20. package/dist/hooks/useModalAnimation.d.ts +2 -4
  21. package/dist/hooks/useTransactions.d.ts +2 -2
  22. package/dist/index.cjs.js +14 -14
  23. package/dist/index.cjs.js.map +1 -0
  24. package/dist/index.esm.js +14 -14
  25. package/dist/index.esm.js.map +1 -0
  26. package/dist/index.iife.js +18 -18
  27. package/dist/index.iife.js.map +1 -0
  28. package/dist/pages/Profile/SelectAsset/index.d.ts +2 -9
  29. package/dist/pages/Profile/Send/index.d.ts +2 -2
  30. package/dist/pages/Profile/Swap/AssetBox/index.d.ts +5 -2
  31. package/dist/stellar/getTransactionDetails.d.ts +1 -1
  32. package/dist/stellar/processes/connectWalletProcess.d.ts +2 -2
  33. package/dist/stellar/swapTransaction.d.ts +4 -0
  34. package/dist/store.d.ts +9 -1
  35. package/dist/utils/helpers.d.ts +15 -6
  36. package/dist/utils/initializeWalletConnect.d.ts +6 -2
  37. package/dist/wallets/albedo.d.ts +1 -1
  38. package/dist/wallets/freighter.d.ts +1 -1
  39. package/dist/wallets/hana.d.ts +1 -1
  40. package/dist/wallets/hot.d.ts +1 -1
  41. package/dist/wallets/klever.d.ts +1 -1
  42. package/dist/wallets/lobstr.d.ts +1 -1
  43. package/dist/wallets/rabet.d.ts +1 -1
  44. package/dist/wallets/xbull.d.ts +1 -1
  45. package/package.json +2 -2
  46. package/dist/components/Modal/Backdrop/index.d.ts +0 -7
  47. package/dist/pages/Profile/Send/SendForm.d.ts +0 -2
@@ -1,9 +1,2 @@
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) => import("react/jsx-runtime").JSX.Element;
9
- export default SelectAssets;
1
+ declare const SelectAsset: () => import("react/jsx-runtime").JSX.Element;
2
+ export default SelectAsset;
@@ -1,2 +1,2 @@
1
- declare const Send: () => import("react/jsx-runtime").JSX.Element;
2
- export default Send;
1
+ declare const SendForm: () => import("react/jsx-runtime").JSX.Element;
2
+ export default SendForm;
@@ -1,4 +1,7 @@
1
- declare const AssetBox: ({ handleOpenAssets }: {
1
+ import { IAsset } from '../../../../types';
2
+ type AssetBoxProps = {
3
+ asset: IAsset;
2
4
  handleOpenAssets: () => void;
3
- }) => import("react/jsx-runtime").JSX.Element;
5
+ };
6
+ declare const AssetBox: ({ handleOpenAssets, asset }: AssetBoxProps) => import("react/jsx-runtime").JSX.Element;
4
7
  export default AssetBox;
@@ -2,7 +2,7 @@ declare const getTransactionDetails: (xdr: string, network: string) => {
2
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
3
  operations: number;
4
4
  sender: string;
5
- receiver: string | null;
5
+ receiver: string;
6
6
  estimatedFee: number;
7
7
  } | null;
8
8
  export default getTransactionDetails;
@@ -1,4 +1,4 @@
1
- import { IStore } from "../../store";
2
- import { IWallet } from "../../types";
1
+ import { IStore } from '../../store';
2
+ import { IWallet } from '../../types';
3
3
  declare const connectWalletProcess: (store: IStore, wallet: IWallet) => Promise<void>;
4
4
  export default connectWalletProcess;
@@ -0,0 +1,4 @@
1
+ import { HorizonServer } from '@stellar/stellar-sdk/lib/horizon/server';
2
+ import { IAsset } from '../types';
3
+ declare const swapTransaction: (rawFromAmount: string, rawToAmount: string, lastFieldChanged: "from" | "to", fromAsset: IAsset, toAsset: IAsset, path: IAsset[], sourceAddress: string, server: HorizonServer, networkPassphrase: string, isChangeTrustNeeded: boolean) => Promise<string>;
4
+ export default swapTransaction;
package/dist/store.d.ts CHANGED
@@ -3,7 +3,7 @@ import { SignClient } from '@walletconnect/sign-client/dist/types/client';
3
3
  import { Route } from './enums';
4
4
  import { UseBalancesResult } from './hooks/useBalances';
5
5
  import { UseTransactionsResult } from './hooks/useTransactions';
6
- import { IWallet, ISignMessage, IInternalConfig, ISendTransaction } from './types';
6
+ import { IWallet, ISignMessage, IInternalConfig, ISendTransaction, IAsset } from './types';
7
7
  export type WaitingStatus = 'login' | 'sendTransaction' | 'signMessage';
8
8
  export type AlertType = 'error' | 'success' | 'info' | 'warn' | 'none';
9
9
  export interface IUser {
@@ -19,6 +19,12 @@ export interface IStellarConfig {
19
19
  soroban: rpc.Server;
20
20
  };
21
21
  }
22
+ export interface ISelectAsset {
23
+ field: 'send' | 'swapFrom' | 'swapTo';
24
+ sendAsset: IAsset;
25
+ swapToAsset: IAsset;
26
+ swapFromAsset: IAsset;
27
+ }
22
28
  export interface IStoreProperties {
23
29
  config: IInternalConfig;
24
30
  user?: IUser;
@@ -43,6 +49,7 @@ export interface IStoreProperties {
43
49
  signMessage?: ISignMessage;
44
50
  balances: UseBalancesResult;
45
51
  transactions: UseTransactionsResult;
52
+ selectAsset: ISelectAsset;
46
53
  walletConnect?: {
47
54
  connection: any;
48
55
  client: SignClient;
@@ -66,6 +73,7 @@ export interface IStoreMethods {
66
73
  setAlert: (alert: AlertType, message: string) => void;
67
74
  setDynamicTitle: (title: string) => void;
68
75
  setBalances: (balances: UseBalancesResult) => void;
76
+ setSelectAsset: (selectAsset: ISelectAsset) => void;
69
77
  setTransactions: (transactions: UseTransactionsResult) => void;
70
78
  setWalletConnectClient: (client: SignClient, connection: any) => void;
71
79
  }
@@ -1,12 +1,20 @@
1
- import translations from "../constants/locales";
2
- import { SupportedWallet } from "../enums";
3
- import { ITransports, IWallet, IExplorer, LanguageKey, IAsset } from "../types";
4
- import { INetworkTransports } from "../constants/networkDetails";
5
- import { Horizon } from "@stellar/stellar-sdk";
6
- export declare const addXLMToBalances: (balances: IAsset[]) => IAsset[];
1
+ import { Asset, Horizon } from '@stellar/stellar-sdk';
2
+ import translations from '../constants/locales';
3
+ import { Route, SupportedWallet } from '../enums';
4
+ import { ITransports, IWallet, IExplorer, LanguageKey, IAsset } from '../types';
5
+ import { INetworkTransports } from '../constants/networkDetails';
6
+ export declare const iAssetToAsset: (asset: IAsset) => Asset;
7
+ export declare const addXLMToBalances: (balances: IAsset[]) => {
8
+ assetIssuer: string;
9
+ assetCode: string;
10
+ assetBalance: string;
11
+ assetType: string;
12
+ }[];
13
+ export declare const isChangeTrustNeeded: (to: string, asset: IAsset, balances: Horizon.HorizonApi.BalanceLine[]) => boolean;
7
14
  export declare const balanceToAsset: (balance: Horizon.HorizonApi.BalanceLine) => IAsset;
8
15
  export declare const capitalizeFirstLetter: (str: string) => string;
9
16
  export declare const copyText: (text: string) => Promise<void>;
17
+ export declare const decideBackRouteFromSelectAsset: (field: "send" | "swapTo" | "swapFrom") => Route.SEND | Route.SWAP;
10
18
  export declare const formatDate: (isoString: string) => string;
11
19
  export declare const getActiveNetworkTitle: (activeNetwork: string) => string;
12
20
  export declare const getContrastColor: (bgColor: string) => string;
@@ -28,4 +36,5 @@ export declare const shortenAddress: (address: string, numChars?: number) => str
28
36
  export declare const timeout: (waiter: number) => Promise<unknown>;
29
37
  export declare const toTitleFormat: (str: string) => string;
30
38
  export declare const translate: (key: keyof typeof translations, lang: LanguageKey, vars?: Record<string, string>) => string;
39
+ export declare const getNetworkNamesFromPassphrase: (userNetworks: string[]) => string[];
31
40
  export declare const validateNetworkOptions: (networks: string[], defaultNetwork: string | undefined, transports: ITransports | undefined) => void;
@@ -1,3 +1,7 @@
1
+ import SignClient from '@walletconnect/sign-client';
1
2
  import { IWalletConnectMetaData } from '../types';
2
- declare const initializeWalletConnect: (wc: IWalletConnectMetaData, appName: string) => Promise<void>;
3
- export default initializeWalletConnect;
3
+ export declare const initializeWalletConnect: (wc: IWalletConnectMetaData, appName: string) => Promise<void>;
4
+ export declare const generateWalletConnectSession: (client: SignClient) => Promise<{
5
+ uri?: string;
6
+ approval: () => Promise<import("@walletconnect/types").SessionTypes.Struct>;
7
+ }>;
@@ -1,2 +1,2 @@
1
- import { IWallet } from "../types";
1
+ import { IWallet } from '../types';
2
2
  export declare const albedoConfig: IWallet;
@@ -1,2 +1,2 @@
1
- import { IWallet } from "../types";
1
+ import { IWallet } from '../types';
2
2
  export declare const freighterConfig: IWallet;
@@ -1,2 +1,2 @@
1
- import { IWallet } from "../types";
1
+ import { IWallet } from '../types';
2
2
  export declare const hanaConfig: IWallet;
@@ -1,2 +1,2 @@
1
- import { IWallet } from "../types";
1
+ import { IWallet } from '../types';
2
2
  export declare const hotConfig: IWallet;
@@ -1,2 +1,2 @@
1
- import { IWallet } from "../types";
1
+ import { IWallet } from '../types';
2
2
  export declare const kleverConfig: IWallet;
@@ -1,2 +1,2 @@
1
- import { IWallet } from "../types";
1
+ import { IWallet } from '../types';
2
2
  export declare const lobstrConfig: IWallet;
@@ -1,2 +1,2 @@
1
- import { IWallet } from "../types";
1
+ import { IWallet } from '../types';
2
2
  export declare const rabetConfig: IWallet;
@@ -1,2 +1,2 @@
1
- import { IWallet } from "../types";
1
+ import { IWallet } from '../types';
2
2
  export declare const xBullConfig: IWallet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluxcc/core",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "homepage": "https://blux.cc",
5
5
  "description": "Blux is a wallet infra for the Stellar network",
6
6
  "type": "module",
@@ -53,10 +53,10 @@
53
53
  "@tailwindcss/postcss": "^4.1.13",
54
54
  "@types/react": "^19.1.12",
55
55
  "@types/react-dom": "^19.1.9",
56
+ "prettier": "^3.6.2",
56
57
  "rollup-plugin-peer-deps-external": "^2.2.4",
57
58
  "rollup-plugin-polyfill-node": "^0.13.0",
58
59
  "rollup-plugin-postcss": "^4.0.2",
59
- "prettier": "^3.6.2",
60
60
  "rollup-plugin-terser": "^7.0.2",
61
61
  "tailwindcss": "^4.1.13",
62
62
  "tslib": "^2.8.1",
@@ -1,7 +0,0 @@
1
- interface BackdropProps {
2
- isClosing: boolean;
3
- isSticky?: boolean;
4
- onClose: () => void;
5
- }
6
- declare const ModalBackdrop: ({ isClosing, onClose, isSticky, }: BackdropProps) => import("react/jsx-runtime").JSX.Element;
7
- export default ModalBackdrop;
@@ -1,2 +0,0 @@
1
- declare const SendForm: () => import("react/jsx-runtime").JSX.Element;
2
- export default SendForm;