@bluxcc/react 0.1.10 → 0.1.12
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/logos.d.ts +1 -0
- package/dist/components/Transaction/Summary/index.d.ts +11 -0
- package/dist/constants/explorers.d.ts +9 -0
- package/dist/containers/BluxModal/content.d.ts +1 -5
- package/dist/containers/Pages/OnBoarding/index.d.ts +1 -5
- package/dist/hooks/useBlux.d.ts +9 -1
- package/dist/index.cjs.js +1 -2179
- package/dist/index.esm.js +1 -2167
- package/dist/types/index.d.ts +20 -7
- package/dist/useStellar/useBalance.d.ts +1 -1
- package/dist/useStellar/useTransactions.d.ts +1 -1
- package/dist/utils/stellar/finalizeSorobanTransaction.d.ts +3 -0
- package/dist/utils/stellar/getExplorerUrl.d.ts +2 -1
- package/dist/utils/stellar/getTransactionDetails.d.ts +2 -1
- package/dist/utils/stellar/submitTransaction.d.ts +9 -3
- package/dist/wallets/configs/hanaConfig.d.ts +2 -0
- package/package.json +1 -1
- package/dist/components/Transaction/Summery/index.d.ts +0 -9
- package/dist/hooks/useAccount.d.ts +0 -12
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js.map +0 -1
- package/dist/utils/getBorderRadius.d.ts +0 -3
- package/dist/utils/network/fallback.d.ts +0 -13
- package/dist/utils/stellar/getNetworkPassphrase.d.ts +0 -2
- package/dist/utils/stellar/getStellarServer.d.ts +0 -6
- package/dist/utils/stellar/getTransactions.d.ts +0 -7
package/dist/types/index.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ export declare enum SupportedWallets {
|
|
|
9
9
|
Albedo = "Albedo",
|
|
10
10
|
Freighter = "Freighter",
|
|
11
11
|
Xbull = "xBull",
|
|
12
|
-
Lobstr = "LOBSTR"
|
|
12
|
+
Lobstr = "LOBSTR",
|
|
13
|
+
Hana = "Hana"
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Enum defining the various Stellar network environments.
|
|
@@ -35,6 +36,7 @@ interface IServers {
|
|
|
35
36
|
soroban: Url;
|
|
36
37
|
}
|
|
37
38
|
export type ITransports = Record<string, IServers>;
|
|
39
|
+
export type IExplorers = 'steexp' | 'stellarchain' | 'stellarexpert' | 'lumenscan';
|
|
38
40
|
/**
|
|
39
41
|
* BluxProvider.config
|
|
40
42
|
*/
|
|
@@ -44,6 +46,7 @@ export interface IProviderConfig {
|
|
|
44
46
|
defaultNetwork: string;
|
|
45
47
|
appearance?: Partial<IAppearance>;
|
|
46
48
|
transports?: ITransports;
|
|
49
|
+
explorer?: IExplorers;
|
|
47
50
|
loginMethods?: Array<'wallet' | 'email' | 'sms' | 'google' | 'twitter' | 'discord' | 'github' | 'passkey'>;
|
|
48
51
|
}
|
|
49
52
|
/**
|
|
@@ -51,6 +54,7 @@ export interface IProviderConfig {
|
|
|
51
54
|
* Appearance will be set to default values if the user does not provider appearance (or provides some of the values in Appearance)
|
|
52
55
|
*/
|
|
53
56
|
export interface IConfig extends IProviderConfig {
|
|
57
|
+
explorer: IExplorers;
|
|
54
58
|
appearance: IAppearance;
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
@@ -112,13 +116,9 @@ export interface ContextInterface {
|
|
|
112
116
|
isAuthenticated: boolean;
|
|
113
117
|
availableWallets: WalletInterface[];
|
|
114
118
|
waitingStatus: 'connecting' | 'signing';
|
|
119
|
+
showAllWallets: boolean;
|
|
115
120
|
activeNetwork: string;
|
|
116
|
-
signTransaction:
|
|
117
|
-
xdr: string;
|
|
118
|
-
network: string;
|
|
119
|
-
resolver: ((value: HorizonApi.SubmitTransactionResponse) => void) | null;
|
|
120
|
-
result: HorizonApi.SubmitTransactionResponse | null;
|
|
121
|
-
};
|
|
121
|
+
signTransaction: ISignTransaction<boolean>;
|
|
122
122
|
servers: {
|
|
123
123
|
horizon: Horizon.Server;
|
|
124
124
|
soroban: rpc.Server;
|
|
@@ -176,6 +176,19 @@ export interface GetNetworkResult {
|
|
|
176
176
|
}
|
|
177
177
|
export interface ISendTransactionOptions {
|
|
178
178
|
network?: string;
|
|
179
|
+
isSoroban?: boolean;
|
|
180
|
+
}
|
|
181
|
+
export type ISendTransactionOptionsInternal = {
|
|
182
|
+
network: string;
|
|
183
|
+
isSoroban: boolean;
|
|
184
|
+
};
|
|
185
|
+
export type TransactionResponseType<T extends boolean> = T extends true ? rpc.Api.GetSuccessfulTransactionResponse : HorizonApi.SubmitTransactionResponse;
|
|
186
|
+
export interface ISignTransaction<IsSoroban extends boolean> {
|
|
187
|
+
options: ISendTransactionOptionsInternal;
|
|
188
|
+
xdr: string;
|
|
189
|
+
rejecter: ((reason: any) => void) | null;
|
|
190
|
+
result: TransactionResponseType<IsSoroban> | null;
|
|
191
|
+
resolver: ((value: TransactionResponseType<IsSoroban>) => void) | null;
|
|
179
192
|
}
|
|
180
193
|
/**
|
|
181
194
|
* Defines the available actions for interacting with a wallet.
|
|
@@ -5,9 +5,9 @@ type UseBalanceParams = {
|
|
|
5
5
|
asset?: string | Asset;
|
|
6
6
|
};
|
|
7
7
|
interface UseBalanceResult {
|
|
8
|
+
balance: string;
|
|
8
9
|
loading: boolean;
|
|
9
10
|
error: Error | null;
|
|
10
|
-
balance: string | null;
|
|
11
11
|
}
|
|
12
12
|
declare const useBalance: ({ asset, address, network }: UseBalanceParams) => UseBalanceResult;
|
|
13
13
|
export default useBalance;
|
|
@@ -12,7 +12,7 @@ type TransactionRecord<T extends boolean> = T extends true ? TransactionRecordWi
|
|
|
12
12
|
interface UseTransactionsResult<T extends boolean> {
|
|
13
13
|
loading: boolean;
|
|
14
14
|
error: Error | null;
|
|
15
|
-
transactions: TransactionRecord<T>[]
|
|
15
|
+
transactions: TransactionRecord<T>[];
|
|
16
16
|
}
|
|
17
17
|
declare const useTransactions: <T extends boolean = false>(params?: UseTransactionsProps<T>) => UseTransactionsResult<T>;
|
|
18
18
|
export default useTransactions;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { IExplorers } from '../../types';
|
|
2
|
+
declare const getExplorerUrl: (networkPassphrase: string, explorerProvider: IExplorers, endpoint: "accountUrl" | "transactionUrl" | "operationUrl" | "ledgerUrl", value: string) => string | null;
|
|
2
3
|
export default getExplorerUrl;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
declare const getTransactionDetails: (xdr: string, network: string) => {
|
|
2
|
-
action: "
|
|
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
6
|
estimatedFee: number;
|
|
6
7
|
} | null;
|
|
7
8
|
export default getTransactionDetails;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { Horizon } from '@stellar/stellar-sdk';
|
|
2
|
-
import { ITransports } from '../../types';
|
|
3
|
-
declare
|
|
1
|
+
import { Horizon, rpc } from '@stellar/stellar-sdk';
|
|
2
|
+
import { ISendTransactionOptionsInternal, ITransports } from '../../types';
|
|
3
|
+
declare function submitTransaction(xdr: string, options: ISendTransactionOptionsInternal & {
|
|
4
|
+
isSoroban: true;
|
|
5
|
+
}, transports: ITransports): Promise<rpc.Api.GetSuccessfulTransactionResponse>;
|
|
6
|
+
declare function submitTransaction(xdr: string, options: ISendTransactionOptionsInternal & {
|
|
7
|
+
isSoroban?: false;
|
|
8
|
+
}, transports: ITransports): Promise<Horizon.HorizonApi.SubmitTransactionResponse>;
|
|
9
|
+
declare function submitTransaction(xdr: string, options: ISendTransactionOptionsInternal, transports: ITransports): Promise<rpc.Api.GetSuccessfulTransactionResponse | Horizon.HorizonApi.SubmitTransactionResponse>;
|
|
4
10
|
export default submitTransaction;
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface SummaryProps {
|
|
3
|
-
operationsCount: number;
|
|
4
|
-
sender: string;
|
|
5
|
-
estimatedFee: string;
|
|
6
|
-
action: string;
|
|
7
|
-
}
|
|
8
|
-
declare const Summary: ({ operationsCount, sender, estimatedFee, action, }: SummaryProps) => React.JSX.Element;
|
|
9
|
-
export default Summary;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AccountData } from '../types';
|
|
2
|
-
interface AccountHookResult {
|
|
3
|
-
account: AccountData | null;
|
|
4
|
-
loading: boolean;
|
|
5
|
-
error: string | null;
|
|
6
|
-
}
|
|
7
|
-
interface AccountHookProps {
|
|
8
|
-
publicKey: string;
|
|
9
|
-
passphrase: string;
|
|
10
|
-
}
|
|
11
|
-
declare const useAccount: ({ publicKey, passphrase, }: AccountHookProps) => AccountHookResult;
|
|
12
|
-
export default useAccount;
|