@bluxcc/core 0.1.2 → 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.
- package/dist/assets/Icons.d.ts +6 -0
- package/dist/assets/Logos.d.ts +2 -0
- package/dist/components/AssetsList/index.d.ts +1 -1
- package/dist/components/Button/index.d.ts +7 -5
- package/dist/components/CardItem/index.d.ts +4 -4
- package/dist/components/Header/index.d.ts +1 -1
- package/dist/components/Input/index.d.ts +4 -3
- package/dist/components/Modal/index.d.ts +2 -2
- package/dist/components/TabBox/index.d.ts +1 -1
- package/dist/constants/assets.d.ts +18 -0
- package/dist/constants/consts.d.ts +2 -0
- package/dist/constants/locales.d.ts +1 -1
- package/dist/constants/routes.d.ts +2 -2
- package/dist/enums.d.ts +2 -1
- package/dist/exports/core/getBalances.d.ts +1 -1
- package/dist/exports/utils.d.ts +2 -2
- package/dist/hooks/useBalances.d.ts +1 -1
- package/dist/hooks/useCheckWalletNetwork.d.ts +3 -0
- package/dist/hooks/useDynamicHeight.d.ts +2 -1
- package/dist/hooks/useLockBodyScroll.d.ts +1 -0
- package/dist/hooks/useModalAnimation.d.ts +2 -4
- package/dist/hooks/useTransactions.d.ts +2 -2
- package/dist/index.cjs.js +14 -14
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.esm.js +14 -14
- package/dist/index.esm.js.map +1 -0
- package/dist/index.iife.js +18 -18
- package/dist/index.iife.js.map +1 -0
- package/dist/pages/Profile/SelectAsset/index.d.ts +2 -9
- package/dist/pages/Profile/Send/index.d.ts +2 -2
- package/dist/pages/Profile/Swap/AssetBox/index.d.ts +5 -2
- package/dist/stellar/getTransactionDetails.d.ts +1 -1
- package/dist/stellar/processes/connectWalletProcess.d.ts +2 -2
- package/dist/stellar/swapTransaction.d.ts +4 -0
- package/dist/store.d.ts +9 -1
- package/dist/utils/helpers.d.ts +15 -6
- package/dist/utils/initializeWalletConnect.d.ts +6 -2
- package/dist/wallets/albedo.d.ts +1 -1
- package/dist/wallets/freighter.d.ts +1 -1
- package/dist/wallets/hana.d.ts +1 -1
- package/dist/wallets/hot.d.ts +1 -1
- package/dist/wallets/klever.d.ts +1 -1
- package/dist/wallets/lobstr.d.ts +1 -1
- package/dist/wallets/rabet.d.ts +1 -1
- package/dist/wallets/xbull.d.ts +1 -1
- package/package.json +2 -2
- package/dist/components/Modal/Backdrop/index.d.ts +0 -7
- package/dist/pages/Profile/Send/SendForm.d.ts +0 -2
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
2
|
-
export default
|
|
1
|
+
declare const SendForm: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default SendForm;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { IAsset } from '../../../../types';
|
|
2
|
+
type AssetBoxProps = {
|
|
3
|
+
asset: IAsset;
|
|
2
4
|
handleOpenAssets: () => void;
|
|
3
|
-
}
|
|
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
|
|
5
|
+
receiver: string;
|
|
6
6
|
estimatedFee: number;
|
|
7
7
|
} | null;
|
|
8
8
|
export default getTransactionDetails;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IStore } from
|
|
2
|
-
import { IWallet } from
|
|
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
|
}
|
package/dist/utils/helpers.d.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
export declare const
|
|
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
|
|
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
|
+
}>;
|
package/dist/wallets/albedo.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IWallet } from
|
|
1
|
+
import { IWallet } from '../types';
|
|
2
2
|
export declare const albedoConfig: IWallet;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IWallet } from
|
|
1
|
+
import { IWallet } from '../types';
|
|
2
2
|
export declare const freighterConfig: IWallet;
|
package/dist/wallets/hana.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IWallet } from
|
|
1
|
+
import { IWallet } from '../types';
|
|
2
2
|
export declare const hanaConfig: IWallet;
|
package/dist/wallets/hot.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IWallet } from
|
|
1
|
+
import { IWallet } from '../types';
|
|
2
2
|
export declare const hotConfig: IWallet;
|
package/dist/wallets/klever.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IWallet } from
|
|
1
|
+
import { IWallet } from '../types';
|
|
2
2
|
export declare const kleverConfig: IWallet;
|
package/dist/wallets/lobstr.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IWallet } from
|
|
1
|
+
import { IWallet } from '../types';
|
|
2
2
|
export declare const lobstrConfig: IWallet;
|
package/dist/wallets/rabet.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IWallet } from
|
|
1
|
+
import { IWallet } from '../types';
|
|
2
2
|
export declare const rabetConfig: IWallet;
|
package/dist/wallets/xbull.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IWallet } from
|
|
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
|
+
"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",
|