@bluxcc/react 0.1.10 → 0.1.11
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/constants/explorers.d.ts +9 -0
- 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 +17 -6
- 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 +1 -1
- package/dist/utils/stellar/submitTransaction.d.ts +9 -3
- package/package.json +1 -1
- 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
|
@@ -35,6 +35,7 @@ interface IServers {
|
|
|
35
35
|
soroban: Url;
|
|
36
36
|
}
|
|
37
37
|
export type ITransports = Record<string, IServers>;
|
|
38
|
+
export type IExplorers = 'steexp' | 'stellarchain' | 'stellarexpert' | 'lumenscan';
|
|
38
39
|
/**
|
|
39
40
|
* BluxProvider.config
|
|
40
41
|
*/
|
|
@@ -44,6 +45,7 @@ export interface IProviderConfig {
|
|
|
44
45
|
defaultNetwork: string;
|
|
45
46
|
appearance?: Partial<IAppearance>;
|
|
46
47
|
transports?: ITransports;
|
|
48
|
+
explorer?: IExplorers;
|
|
47
49
|
loginMethods?: Array<'wallet' | 'email' | 'sms' | 'google' | 'twitter' | 'discord' | 'github' | 'passkey'>;
|
|
48
50
|
}
|
|
49
51
|
/**
|
|
@@ -51,6 +53,7 @@ export interface IProviderConfig {
|
|
|
51
53
|
* Appearance will be set to default values if the user does not provider appearance (or provides some of the values in Appearance)
|
|
52
54
|
*/
|
|
53
55
|
export interface IConfig extends IProviderConfig {
|
|
56
|
+
explorer: IExplorers;
|
|
54
57
|
appearance: IAppearance;
|
|
55
58
|
}
|
|
56
59
|
/**
|
|
@@ -113,12 +116,7 @@ export interface ContextInterface {
|
|
|
113
116
|
availableWallets: WalletInterface[];
|
|
114
117
|
waitingStatus: 'connecting' | 'signing';
|
|
115
118
|
activeNetwork: string;
|
|
116
|
-
signTransaction:
|
|
117
|
-
xdr: string;
|
|
118
|
-
network: string;
|
|
119
|
-
resolver: ((value: HorizonApi.SubmitTransactionResponse) => void) | null;
|
|
120
|
-
result: HorizonApi.SubmitTransactionResponse | null;
|
|
121
|
-
};
|
|
119
|
+
signTransaction: ISignTransaction<boolean>;
|
|
122
120
|
servers: {
|
|
123
121
|
horizon: Horizon.Server;
|
|
124
122
|
soroban: rpc.Server;
|
|
@@ -176,6 +174,19 @@ export interface GetNetworkResult {
|
|
|
176
174
|
}
|
|
177
175
|
export interface ISendTransactionOptions {
|
|
178
176
|
network?: string;
|
|
177
|
+
isSoroban?: boolean;
|
|
178
|
+
}
|
|
179
|
+
export type ISendTransactionOptionsInternal = {
|
|
180
|
+
network: string;
|
|
181
|
+
isSoroban: boolean;
|
|
182
|
+
};
|
|
183
|
+
export type TransactionResponseType<T extends boolean> = T extends true ? rpc.Api.GetSuccessfulTransactionResponse : HorizonApi.SubmitTransactionResponse;
|
|
184
|
+
export interface ISignTransaction<IsSoroban extends boolean> {
|
|
185
|
+
options: ISendTransactionOptionsInternal;
|
|
186
|
+
xdr: string;
|
|
187
|
+
rejecter: ((reason: any) => void) | null;
|
|
188
|
+
result: TransactionResponseType<IsSoroban> | null;
|
|
189
|
+
resolver: ((value: TransactionResponseType<IsSoroban>) => void) | null;
|
|
179
190
|
}
|
|
180
191
|
/**
|
|
181
192
|
* 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,5 +1,5 @@
|
|
|
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
5
|
estimatedFee: number;
|
|
@@ -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,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;
|