@bluxcc/react 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/README.md +6 -6
- package/dist/assets/Icons.d.ts +29 -7
- package/dist/assets/logos.d.ts +8 -7
- package/dist/components/CardItem/index.d.ts +7 -3
- package/dist/components/Input/OTPInput.d.ts +6 -1
- package/dist/components/Input/index.d.ts +3 -3
- package/dist/components/Modal/index.d.ts +1 -2
- package/dist/constants/index.d.ts +0 -2
- package/dist/containers/Pages/ConfirmCode/index.d.ts +1 -1
- package/dist/context/provider.d.ts +5 -4
- package/dist/index.cjs.js +1 -1405
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.esm.js +1 -1399
- package/dist/index.esm.js.map +1 -1
- package/dist/networks.d.ts +8 -0
- package/dist/types/index.d.ts +31 -13
- package/dist/utils/getWalletNetwork.d.ts +3 -0
- package/dist/utils/network/fallback.d.ts +13 -0
- package/dist/utils/network/url.d.ts +12 -0
- package/dist/utils/setWalletNetwork.d.ts +3 -0
- package/dist/utils/stellar/getTransactionDetails.d.ts +1 -1
- package/dist/utils/stellar/getTransactions.d.ts +7 -0
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Horizon } from '@stellar/stellar-sdk';
|
|
2
|
-
import {
|
|
2
|
+
import { Url } from '../utils/network/url';
|
|
3
|
+
import { Fallback } from '../utils/network/fallback';
|
|
4
|
+
import { History } from '../utils/stellar/getTransactions';
|
|
3
5
|
/**
|
|
4
6
|
* Enum representing the supported wallets in the system.
|
|
5
7
|
*/
|
|
@@ -23,24 +25,32 @@ export declare enum WalletNetwork {
|
|
|
23
25
|
export interface AccountData {
|
|
24
26
|
id: string;
|
|
25
27
|
sequence: string;
|
|
28
|
+
xlmBalance: string;
|
|
26
29
|
subentry_count: number;
|
|
27
|
-
thresholds: Horizon.HorizonApi.AccountThresholds;
|
|
28
30
|
balances: Horizon.HorizonApi.BalanceLine[];
|
|
29
|
-
|
|
30
|
-
transactions?:
|
|
31
|
+
thresholds: Horizon.HorizonApi.AccountThresholds;
|
|
32
|
+
transactions?: History[];
|
|
33
|
+
}
|
|
34
|
+
interface IServers {
|
|
35
|
+
horizon?: Url | Fallback;
|
|
36
|
+
soroban?: Url | Fallback;
|
|
31
37
|
}
|
|
38
|
+
export type ITransports = Record<string, IServers>;
|
|
32
39
|
/**
|
|
33
40
|
* Configuration options for the provider.
|
|
34
41
|
*/
|
|
35
42
|
export interface IProviderConfig {
|
|
36
43
|
appName: string;
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
networks: string[];
|
|
45
|
+
appearance: IAppearance;
|
|
46
|
+
transports?: ITransports;
|
|
47
|
+
loginMethods?: Array<'wallet' | 'email' | 'sms' | 'google' | 'twitter' | 'discord' | 'github' | 'passkey'>;
|
|
39
48
|
}
|
|
40
49
|
/**
|
|
41
50
|
* Information about the connected wallet.
|
|
42
51
|
*/
|
|
43
52
|
export interface WalletInfo {
|
|
53
|
+
passphrase: string;
|
|
44
54
|
name: SupportedWallets;
|
|
45
55
|
address: string | null;
|
|
46
56
|
}
|
|
@@ -49,6 +59,8 @@ export interface WalletInfo {
|
|
|
49
59
|
*/
|
|
50
60
|
export interface IUser {
|
|
51
61
|
wallet: WalletInfo | null;
|
|
62
|
+
email: string | null;
|
|
63
|
+
phoneNumber: number | null;
|
|
52
64
|
}
|
|
53
65
|
/**
|
|
54
66
|
* Context state management interface.
|
|
@@ -77,14 +89,13 @@ export interface IAppearance {
|
|
|
77
89
|
textColor: string;
|
|
78
90
|
font: SupportedFonts;
|
|
79
91
|
cornerRadius: CornerRadius;
|
|
80
|
-
|
|
92
|
+
logo?: React.ImgHTMLAttributes<HTMLImageElement>['src'];
|
|
81
93
|
}
|
|
82
94
|
/**
|
|
83
95
|
* Structure of the global context values.
|
|
84
96
|
*/
|
|
85
97
|
export interface ContextInterface {
|
|
86
98
|
config: IProviderConfig;
|
|
87
|
-
appearance: IAppearance;
|
|
88
99
|
user: IUser;
|
|
89
100
|
isModalOpen: boolean;
|
|
90
101
|
isReady: boolean;
|
|
@@ -94,8 +105,8 @@ export interface ContextInterface {
|
|
|
94
105
|
waitingStatus: 'connecting' | 'signing';
|
|
95
106
|
signTransaction: {
|
|
96
107
|
xdr: string;
|
|
97
|
-
resolver: ((value: HorizonApi.SubmitTransactionResponse) => void) | null;
|
|
98
|
-
result: HorizonApi.SubmitTransactionResponse | null;
|
|
108
|
+
resolver: ((value: Horizon.HorizonApi.SubmitTransactionResponse) => void) | null;
|
|
109
|
+
result: Horizon.HorizonApi.SubmitTransactionResponse | null;
|
|
99
110
|
};
|
|
100
111
|
}
|
|
101
112
|
/**
|
|
@@ -108,7 +119,8 @@ export declare enum Routes {
|
|
|
108
119
|
PROFILE = "PROFILE",// User profile view
|
|
109
120
|
SIGN_TRANSACTION = "SIGN_TRANSACTION",// User sign transaction view
|
|
110
121
|
SEND = "SEND",// User sign transaction view
|
|
111
|
-
ACTIVITY = "ACTIVITY"
|
|
122
|
+
ACTIVITY = "ACTIVITY",// User sign transaction view
|
|
123
|
+
OTP = "OTP"
|
|
112
124
|
}
|
|
113
125
|
/**
|
|
114
126
|
* Modal state management interface.
|
|
@@ -128,6 +140,7 @@ export interface ModalHeights {
|
|
|
128
140
|
[Routes.SIGN_TRANSACTION]: number;
|
|
129
141
|
[Routes.SEND]: number;
|
|
130
142
|
[Routes.ACTIVITY]: number;
|
|
143
|
+
[Routes.OTP]: number;
|
|
131
144
|
}
|
|
132
145
|
/**
|
|
133
146
|
* Represents the result of a successful wallet connection.
|
|
@@ -141,6 +154,10 @@ export interface ConnectResult {
|
|
|
141
154
|
export interface SignResult {
|
|
142
155
|
signedXdr: string;
|
|
143
156
|
}
|
|
157
|
+
export interface GetNetworkResult {
|
|
158
|
+
network: string;
|
|
159
|
+
passphrase: string;
|
|
160
|
+
}
|
|
144
161
|
/**
|
|
145
162
|
* Defines the available actions for interacting with a wallet.
|
|
146
163
|
*/
|
|
@@ -162,9 +179,9 @@ export interface WalletInterface {
|
|
|
162
179
|
submit?: boolean;
|
|
163
180
|
}) => Promise<string>;
|
|
164
181
|
disconnect?: () => Promise<void>;
|
|
165
|
-
getNetwork
|
|
182
|
+
getNetwork: () => Promise<{
|
|
166
183
|
network: string;
|
|
167
|
-
|
|
184
|
+
passphrase: string;
|
|
168
185
|
}>;
|
|
169
186
|
signMessage?: (message: string, options?: {
|
|
170
187
|
networkPassphrase?: string;
|
|
@@ -183,3 +200,4 @@ export interface WalletInterface {
|
|
|
183
200
|
signerPublicKey?: string;
|
|
184
201
|
}>;
|
|
185
202
|
}
|
|
203
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Url } from './url';
|
|
2
|
+
export interface FallbackOptions {
|
|
3
|
+
retryCount?: number;
|
|
4
|
+
retryDelay?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface Fallback extends FallbackOptions {
|
|
7
|
+
urls: Url[];
|
|
8
|
+
}
|
|
9
|
+
export declare const fallback: (urls: Url[], options?: FallbackOptions) => {
|
|
10
|
+
retryCount?: number;
|
|
11
|
+
retryDelay?: number;
|
|
12
|
+
urls: Url[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface UrlOptions {
|
|
2
|
+
allowHttp?: boolean;
|
|
3
|
+
appName?: string;
|
|
4
|
+
appVersion?: string;
|
|
5
|
+
authToken?: string;
|
|
6
|
+
retryCount?: number;
|
|
7
|
+
retryDelay?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface Url extends UrlOptions {
|
|
10
|
+
url: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const url: (urlStr: string, options?: UrlOptions) => Url;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const getTransactionDetails: (xdr: string) => {
|
|
2
|
-
action: "
|
|
2
|
+
action: "payment" | "createAccount" | "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;
|