@bluxcc/react 0.1.5 → 0.1.7
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 +1 -0
- package/dist/components/Modal/Backdrop/index.d.ts +2 -1
- package/dist/components/Modal/index.d.ts +2 -1
- package/dist/components/Transaction/History/index.d.ts +8 -6
- package/dist/components/Transaction/Summery/index.d.ts +1 -1
- package/dist/constants/index.d.ts +2 -1
- package/dist/constants/networkDetails.d.ts +8 -0
- package/dist/containers/BluxModal/content.d.ts +4 -2
- package/dist/containers/Pages/WrongNetwork/index.d.ts +3 -0
- package/dist/context/provider.d.ts +2 -2
- package/dist/context/useCheckWalletNetwork.d.ts +3 -0
- package/dist/hooks/useAccount.d.ts +1 -1
- package/dist/hooks/useBlux.d.ts +2 -1
- package/dist/hooks/useCheckProvider.d.ts +2 -0
- package/dist/hooks/useCustomNetwork.d.ts +7 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/networks.d.ts +1 -1
- package/dist/types/index.d.ts +20 -8
- package/dist/useStellar/index.d.ts +6 -2
- package/dist/useStellar/useAccount.d.ts +12 -0
- package/dist/useStellar/useBalance.d.ts +11 -6
- package/dist/useStellar/useNetwork.d.ts +2 -0
- package/dist/useStellar/useSwitchNetwork.d.ts +5 -0
- package/dist/useStellar/useTransactions.d.ts +18 -0
- package/dist/utils/formatDate.d.ts +2 -0
- package/dist/utils/getWalletNetwork.d.ts +1 -1
- package/dist/utils/network/getNetworkRpc.d.ts +4 -0
- package/dist/utils/stellar/getTransactionDetails.d.ts +2 -2
- package/dist/utils/stellar/signTransaction.d.ts +1 -1
- package/dist/utils/stellar/submitTransaction.d.ts +2 -1
- package/dist/utils/toTitleFormat.d.ts +2 -0
- package/package.json +3 -1
package/dist/networks.d.ts
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Horizon } from '@stellar/stellar-sdk';
|
|
1
|
+
import { Horizon, rpc } from '@stellar/stellar-sdk';
|
|
2
2
|
import { HorizonApi } from '@stellar/stellar-sdk/lib/horizon';
|
|
3
3
|
import { Url } from '../utils/network/url';
|
|
4
|
-
import { Fallback } from '../utils/network/fallback';
|
|
5
4
|
/**
|
|
6
5
|
* Enum representing the supported wallets in the system.
|
|
7
6
|
*/
|
|
@@ -32,8 +31,8 @@ export interface AccountData {
|
|
|
32
31
|
transactions?: Horizon.ServerApi.TransactionRecord[];
|
|
33
32
|
}
|
|
34
33
|
interface IServers {
|
|
35
|
-
horizon
|
|
36
|
-
soroban
|
|
34
|
+
horizon: Url;
|
|
35
|
+
soroban: Url;
|
|
37
36
|
}
|
|
38
37
|
export type ITransports = Record<string, IServers>;
|
|
39
38
|
/**
|
|
@@ -42,6 +41,7 @@ export type ITransports = Record<string, IServers>;
|
|
|
42
41
|
export interface IProviderConfig {
|
|
43
42
|
appName: string;
|
|
44
43
|
networks: string[];
|
|
44
|
+
defaultNetwork: string;
|
|
45
45
|
appearance?: Partial<IAppearance>;
|
|
46
46
|
transports?: ITransports;
|
|
47
47
|
loginMethods?: Array<'wallet' | 'email' | 'sms' | 'google' | 'twitter' | 'discord' | 'github' | 'passkey'>;
|
|
@@ -81,21 +81,23 @@ export interface ContextState {
|
|
|
81
81
|
/**
|
|
82
82
|
* Supported font options for UI customization.
|
|
83
83
|
*/
|
|
84
|
-
export type SupportedFonts = 'Manrope' | 'Inter' | 'JetBrains Mono' | 'Lora';
|
|
85
84
|
/**
|
|
86
85
|
* Supported corner radius styles for UI elements.
|
|
87
86
|
*/
|
|
88
|
-
export type CornerRadius = 'none' | 'full' | 'sm' | 'md' | 'lg';
|
|
89
87
|
/**
|
|
90
88
|
* Appearance customization options.
|
|
91
89
|
*/
|
|
92
90
|
export interface IAppearance {
|
|
93
91
|
theme: 'light' | 'dark';
|
|
94
92
|
background: string;
|
|
93
|
+
bgField: string;
|
|
95
94
|
accent: string;
|
|
96
95
|
textColor: string;
|
|
97
|
-
font:
|
|
98
|
-
cornerRadius:
|
|
96
|
+
font: string;
|
|
97
|
+
cornerRadius: string;
|
|
98
|
+
borderColor: string;
|
|
99
|
+
borderWidth: string;
|
|
100
|
+
includeBorders: boolean;
|
|
99
101
|
logo?: React.ImgHTMLAttributes<HTMLImageElement>['src'];
|
|
100
102
|
}
|
|
101
103
|
/**
|
|
@@ -110,17 +112,24 @@ export interface ContextInterface {
|
|
|
110
112
|
isAuthenticated: boolean;
|
|
111
113
|
availableWallets: WalletInterface[];
|
|
112
114
|
waitingStatus: 'connecting' | 'signing';
|
|
115
|
+
activeNetwork: string;
|
|
113
116
|
signTransaction: {
|
|
114
117
|
xdr: string;
|
|
118
|
+
network: string;
|
|
115
119
|
resolver: ((value: HorizonApi.SubmitTransactionResponse) => void) | null;
|
|
116
120
|
result: HorizonApi.SubmitTransactionResponse | null;
|
|
117
121
|
};
|
|
122
|
+
servers: {
|
|
123
|
+
horizon: Horizon.Server;
|
|
124
|
+
soroban: rpc.Server;
|
|
125
|
+
};
|
|
118
126
|
}
|
|
119
127
|
/**
|
|
120
128
|
* Enum defining different modal views.
|
|
121
129
|
*/
|
|
122
130
|
export declare enum Routes {
|
|
123
131
|
ONBOARDING = "ONBOARDING",// View for selecting a wallet
|
|
132
|
+
WRONG_NETWORK = "WRONG_NETWORK",// View for selecting a wallet
|
|
124
133
|
WAITING = "WAITING",// View for connection process
|
|
125
134
|
SUCCESSFUL = "SUCCESSFUL",// View for connection success process
|
|
126
135
|
PROFILE = "PROFILE",// User profile view
|
|
@@ -165,6 +174,9 @@ export interface GetNetworkResult {
|
|
|
165
174
|
network: string;
|
|
166
175
|
passphrase: string;
|
|
167
176
|
}
|
|
177
|
+
export interface ISendTransactionOptions {
|
|
178
|
+
network?: string;
|
|
179
|
+
}
|
|
168
180
|
/**
|
|
169
181
|
* Defines the available actions for interacting with a wallet.
|
|
170
182
|
*/
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import useAccount from './useAccount';
|
|
2
|
+
import useBalance from './useBalance';
|
|
3
|
+
import useNetwork from './useNetwork';
|
|
4
|
+
import useTransactions from './useTransactions';
|
|
5
|
+
import useSwitchNetwork from './useSwitchNetwork';
|
|
6
|
+
export { useAccount, useBalance, useNetwork, useTransactions, useSwitchNetwork, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Horizon } from '@stellar/stellar-sdk';
|
|
2
|
+
interface UseAccountProps {
|
|
3
|
+
address?: string;
|
|
4
|
+
network?: string;
|
|
5
|
+
}
|
|
6
|
+
interface UseAccountResult {
|
|
7
|
+
loading: boolean;
|
|
8
|
+
error: Error | null;
|
|
9
|
+
account: Horizon.AccountResponse | null;
|
|
10
|
+
}
|
|
11
|
+
declare const useAccount: (params?: UseAccountProps) => UseAccountResult;
|
|
12
|
+
export default useAccount;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Asset } from "@stellar/stellar-sdk";
|
|
2
|
+
type UseBalanceParams = {
|
|
3
|
+
address?: string;
|
|
4
|
+
network?: string;
|
|
5
|
+
asset?: string | Asset;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
interface UseBalanceResult {
|
|
8
|
+
loading: boolean;
|
|
9
|
+
error: Error | null;
|
|
10
|
+
balance: string | null;
|
|
11
|
+
}
|
|
12
|
+
declare const useBalance: ({ asset, address, network }: UseBalanceParams) => UseBalanceResult;
|
|
8
13
|
export default useBalance;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Horizon } from '@stellar/stellar-sdk';
|
|
2
|
+
interface UseTransactionsProps<T extends boolean = false> {
|
|
3
|
+
limit?: number;
|
|
4
|
+
address?: string;
|
|
5
|
+
network?: string;
|
|
6
|
+
includeOperations?: T;
|
|
7
|
+
}
|
|
8
|
+
interface TransactionRecordWithOperations extends Omit<Horizon.ServerApi.TransactionRecord, 'operations'> {
|
|
9
|
+
operations: Horizon.ServerApi.OperationRecord[];
|
|
10
|
+
}
|
|
11
|
+
type TransactionRecord<T extends boolean> = T extends true ? TransactionRecordWithOperations : Horizon.ServerApi.TransactionRecord;
|
|
12
|
+
interface UseTransactionsResult<T extends boolean> {
|
|
13
|
+
loading: boolean;
|
|
14
|
+
error: Error | null;
|
|
15
|
+
transactions: TransactionRecord<T>[] | null;
|
|
16
|
+
}
|
|
17
|
+
declare const useTransactions: <T extends boolean = false>(params?: UseTransactionsProps<T>) => UseTransactionsResult<T>;
|
|
18
|
+
export default useTransactions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare const getTransactionDetails: (xdr: string) => {
|
|
2
|
-
action: "
|
|
1
|
+
declare const getTransactionDetails: (xdr: string, network: 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
3
|
operations: number;
|
|
4
4
|
sender: string;
|
|
5
5
|
estimatedFee: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { WalletInterface } from '../../types';
|
|
2
|
-
declare const signTransaction: (wallet: WalletInterface, xdr: string, address: string, network: string) => Promise<
|
|
2
|
+
declare const signTransaction: (wallet: WalletInterface, xdr: string, address: string, network: string) => Promise<string>;
|
|
3
3
|
export default signTransaction;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Horizon } from '@stellar/stellar-sdk';
|
|
2
|
-
|
|
2
|
+
import { ITransports } from '../../types';
|
|
3
|
+
declare const submitTransaction: (xdr: string, network: string, transports: ITransports) => Promise<Horizon.HorizonApi.SubmitTransactionResponse>;
|
|
3
4
|
export default submitTransaction;
|
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
|
+
"version": "0.1.7",
|
|
5
5
|
"homepage": "https://blux.cc",
|
|
6
6
|
"description": "Connecting to the Stellar Ecosystem and Beyond",
|
|
7
7
|
"repository": {
|
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
55
55
|
"globals": "^15.14.0",
|
|
56
56
|
"postcss": "^8.4.49",
|
|
57
|
+
"prettier": "^3.5.3",
|
|
58
|
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
57
59
|
"rollup": "^4.29.1",
|
|
58
60
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
59
61
|
"rollup-plugin-postcss": "^4.0.2",
|