@stellar-expert/ui-framework 1.16.7 → 1.17.0
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/CLAUDE.md +35 -0
- package/README.md +1125 -3
- package/account/account-address.js +127 -127
- package/account/available-balance.js +22 -22
- package/account/identicon.js +90 -90
- package/account/signer-key.js +65 -64
- package/api/explorer-api-hooks.js +209 -202
- package/api/explorer-api-paginated-list-hooks.js +441 -440
- package/api/explorer-batch-info-loader.js +111 -85
- package/api/explorer-tx-api.js +28 -28
- package/api/ledger-stream.js +15 -0
- package/asset/amount.js +56 -56
- package/asset/asset-icon.js +41 -41
- package/asset/asset-issuer.js +21 -21
- package/asset/asset-link.js +107 -107
- package/asset/asset-list-hooks.js +59 -59
- package/asset/asset-meta-hooks.js +88 -88
- package/asset/asset-selector.js +72 -71
- package/basic-styles/base.scss +50 -50
- package/basic-styles/grid.scss +1 -1
- package/basic-styles/table.scss +1 -1
- package/claimable-balance/claimable-balance-claimants.js +5 -0
- package/contract/contract-api.js +15 -0
- package/contract/invocation-info-view.js +10 -2
- package/contract/sc-val.js +24 -0
- package/controls/button-group.js +25 -19
- package/controls/button-group.scss +46 -46
- package/controls/button.js +93 -78
- package/controls/button.scss +173 -173
- package/controls/code-block.js +42 -34
- package/controls/code-block.scss +71 -71
- package/controls/dropdown.js +318 -287
- package/controls/dropdown.scss +159 -159
- package/controls/external-link.js +10 -4
- package/controls/info-tooltip.js +23 -16
- package/controls/slider.js +29 -19
- package/controls/tabs.js +94 -94
- package/controls/tabs.scss +70 -70
- package/controls/tooltip.js +244 -240
- package/controls/tooltip.scss +116 -116
- package/controls/update-highlighter.js +32 -27
- package/controls/update-highlighter.scss +7 -7
- package/date/date-selector.js +56 -54
- package/date/elapsed-time.js +28 -21
- package/dex/price-dynamic.js +53 -44
- package/dex/price-dynamic.scss +33 -33
- package/directory/directory-hooks.js +109 -97
- package/effect/effect-description.js +5 -3
- package/errors/error-boundary.js +110 -97
- package/horizon/horizon-account-helpers.js +104 -104
- package/horizon/horizon-ledger-helpers.js +35 -35
- package/horizon/horizon-trades-helper.js +88 -88
- package/horizon/horizon-transaction-helpers.js +36 -36
- package/index.d.ts +1241 -0
- package/interaction/accordion.js +43 -35
- package/interaction/autofocus.js +13 -9
- package/interaction/block-select.js +64 -53
- package/interaction/block-select.scss +21 -21
- package/interaction/copy-to-clipboard.js +25 -18
- package/interaction/inline-progress.js +20 -15
- package/interaction/qr-code.js +34 -34
- package/interaction/responsive.js +20 -20
- package/interaction/spoiler.js +52 -39
- package/interaction/spoiler.scss +6 -6
- package/interaction/theme-selector.js +13 -10
- package/ledger/ledger-entry-href-formatter.js +4 -3
- package/ledger/ledger-entry-link.js +93 -58
- package/ledger/ledger-info-parser.js +28 -0
- package/meta/page-meta-tags.js +243 -238
- package/module/dynamic-module.js +47 -47
- package/package.json +3 -2
- package/state/on-screen-hooks.js +22 -22
- package/state/page-visibility-helpers.js +29 -16
- package/state/page-visibility-hooks.js +13 -11
- package/state/screen-orientation-hooks.js +19 -15
- package/state/state-hooks.js +76 -76
- package/state/stellar-network-hooks.js +56 -44
- package/state/theme.js +29 -28
- package/stellar/key-type.js +92 -91
- package/stellar/ledger-generic-id.js +39 -39
- package/stellar/signature-hint-utils.js +65 -65
- package/toast/toast-notifications-block.js +59 -59
- package/toast/toast-notifications.scss +1 -1
- package/tx/op-description-view.js +84 -81
- package/tx/op-icon.js +98 -98
- package/tx/parser/op-balance-changes.js +66 -66
- package/tx/parser/op-descriptor.js +51 -48
- package/tx/parser/tx-details-parser.js +81 -81
- package/tx/parser/tx-matcher.js +371 -371
- package/tx/parser/type-filter-matcher.js +126 -126
- package/tx/tx-list-hooks.js +32 -18
- package/tx/tx-operations-list.js +117 -116
package/index.d.ts
ADDED
|
@@ -0,0 +1,1241 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// Shared Types
|
|
5
|
+
// ============================================================================
|
|
6
|
+
|
|
7
|
+
export type StellarNetwork = 'public' | 'testnet';
|
|
8
|
+
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// Modules
|
|
11
|
+
// ============================================================================
|
|
12
|
+
|
|
13
|
+
export interface DynamicModuleProps {
|
|
14
|
+
/** Dynamic import function, e.g. () => import('./module') */
|
|
15
|
+
load: () => Promise<any>;
|
|
16
|
+
/** Unique module name for caching */
|
|
17
|
+
module?: string;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const DynamicModule: React.FC<DynamicModuleProps>;
|
|
22
|
+
|
|
23
|
+
// ============================================================================
|
|
24
|
+
// State Management
|
|
25
|
+
// ============================================================================
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* React hook that auto-reinitializes state when dependencies change (deep comparison)
|
|
29
|
+
*/
|
|
30
|
+
export function useDependantState<T>(
|
|
31
|
+
stateInitializer: ((dependencies: any[], prevState?: T) => T) | T,
|
|
32
|
+
dependencies: any[],
|
|
33
|
+
finalizer?: () => void
|
|
34
|
+
): [T, (newState: T | ((prev: T) => T)) => void];
|
|
35
|
+
|
|
36
|
+
/** Simple force-update hook */
|
|
37
|
+
export function useForceUpdate(): () => void;
|
|
38
|
+
|
|
39
|
+
/** useEffect with deep comparison on dependencies */
|
|
40
|
+
export function useDeepEffect(effect: React.EffectCallback, dependencies: any[]): void;
|
|
41
|
+
|
|
42
|
+
/** Hook that tracks element visibility using IntersectionObserver */
|
|
43
|
+
export function useOnScreen(root: React.RefObject<Element>, rootMargin?: string): boolean;
|
|
44
|
+
|
|
45
|
+
/** Get current Stellar network */
|
|
46
|
+
export function getCurrentStellarNetwork(): StellarNetwork;
|
|
47
|
+
|
|
48
|
+
/** Set current Stellar network and notify all subscribers */
|
|
49
|
+
export function setStellarNetwork(network: StellarNetwork): void;
|
|
50
|
+
|
|
51
|
+
/** Subscribe to Stellar network change events */
|
|
52
|
+
export function subscribeToStellarNetworkChange(onChange: (network: StellarNetwork) => void): void;
|
|
53
|
+
|
|
54
|
+
/** React hook that returns current Stellar network and re-renders on change */
|
|
55
|
+
export function useStellarNetwork(): StellarNetwork;
|
|
56
|
+
|
|
57
|
+
/** React hook that tracks screen orientation */
|
|
58
|
+
export function useScreenOrientation(): OrientationType;
|
|
59
|
+
|
|
60
|
+
/** Whether the Page Visibility API is supported */
|
|
61
|
+
export const isDocumentVisibilitySupported: boolean;
|
|
62
|
+
|
|
63
|
+
/** Check if the document tab is currently visible */
|
|
64
|
+
export function isDocumentVisible(): boolean;
|
|
65
|
+
|
|
66
|
+
/** Register a listener for document visibility changes; returns unsubscribe function */
|
|
67
|
+
export function addVisibilityChangeListener(listener: (visible: boolean) => void): () => void;
|
|
68
|
+
|
|
69
|
+
/** React hook for managing day/night theme */
|
|
70
|
+
export function useTheme(): [string, (theme: string | ((current: string) => string)) => void];
|
|
71
|
+
|
|
72
|
+
// ============================================================================
|
|
73
|
+
// Page Meta Tags
|
|
74
|
+
// ============================================================================
|
|
75
|
+
|
|
76
|
+
export interface PageMeta {
|
|
77
|
+
/** Page title */
|
|
78
|
+
title: string;
|
|
79
|
+
/** Page description */
|
|
80
|
+
description: string;
|
|
81
|
+
/** Page image URL */
|
|
82
|
+
image?: string;
|
|
83
|
+
/** Custom metadata tags */
|
|
84
|
+
customMeta?: MetaTagReplacement;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface MetaTagReplacement {
|
|
88
|
+
/** HTML tag name to search for (defaults to "meta") */
|
|
89
|
+
tag?: string;
|
|
90
|
+
/** Tag attribute used to locate existing tags */
|
|
91
|
+
locator: string;
|
|
92
|
+
/** Tag properties to set */
|
|
93
|
+
tags: Array<{ name: string; content: string; attribute?: string }>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Initialize default meta properties for the application */
|
|
97
|
+
export function initMeta(appMetaProps: {
|
|
98
|
+
serviceTitle: string;
|
|
99
|
+
description: string;
|
|
100
|
+
origin: string;
|
|
101
|
+
image?: string;
|
|
102
|
+
imageEndpoint?: string;
|
|
103
|
+
}): void;
|
|
104
|
+
|
|
105
|
+
/** Set or remove the robots noindex meta tag */
|
|
106
|
+
export function setPageNoIndex(noIndex: boolean): void;
|
|
107
|
+
|
|
108
|
+
/** React hook for setting page metadata (title, description, image) */
|
|
109
|
+
export function usePageMetadata(meta: PageMeta): void;
|
|
110
|
+
|
|
111
|
+
// ============================================================================
|
|
112
|
+
// Explorer API
|
|
113
|
+
// ============================================================================
|
|
114
|
+
|
|
115
|
+
export interface APIEndpointParams {
|
|
116
|
+
path: string;
|
|
117
|
+
query?: Record<string, any>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export class ExplorerApiResult {
|
|
121
|
+
constructor(apiEndpoint: string, data?: any, ts?: number);
|
|
122
|
+
/** Relative API URL */
|
|
123
|
+
apiEndpoint: string;
|
|
124
|
+
/** API response data */
|
|
125
|
+
data: any;
|
|
126
|
+
/** Response error message */
|
|
127
|
+
error?: string;
|
|
128
|
+
/** HTTP status code */
|
|
129
|
+
status: number;
|
|
130
|
+
/** Response timestamp */
|
|
131
|
+
fetchedAt: number;
|
|
132
|
+
/** Whether data or error has been received */
|
|
133
|
+
readonly loaded: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Fetch data from Explorer API with caching */
|
|
137
|
+
export function fetchData(
|
|
138
|
+
url: string,
|
|
139
|
+
ttl?: number,
|
|
140
|
+
processResult?: (data: any) => any
|
|
141
|
+
): Promise<{ data: any; ts: number }>;
|
|
142
|
+
|
|
143
|
+
export interface UseExplorerApiOptions {
|
|
144
|
+
/** Auto-refresh interval in seconds */
|
|
145
|
+
refreshInterval?: number;
|
|
146
|
+
/** Cache time-to-live in seconds */
|
|
147
|
+
ttl?: number;
|
|
148
|
+
/** Callback to transform the response */
|
|
149
|
+
processResult?: (data: any) => any;
|
|
150
|
+
/** Allow stale data during URL transitions */
|
|
151
|
+
allowStaleDataTransition?: boolean;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** React hook for fetching data from the Explorer API */
|
|
155
|
+
export function useExplorerApi(
|
|
156
|
+
apiEndpoint: string | APIEndpointParams,
|
|
157
|
+
options?: UseExplorerApiOptions
|
|
158
|
+
): ExplorerApiResult;
|
|
159
|
+
|
|
160
|
+
export interface ExplorerApiListResponse {
|
|
161
|
+
/** Data retrieved from the server */
|
|
162
|
+
data: any[];
|
|
163
|
+
/** Whether response has loaded */
|
|
164
|
+
loaded: boolean;
|
|
165
|
+
/** Whether a request is in progress */
|
|
166
|
+
loading: boolean;
|
|
167
|
+
/** Load page function (1 for next, -1 for previous) */
|
|
168
|
+
load: (page?: 1 | -1) => Promise<ExplorerApiListResponse>;
|
|
169
|
+
/** Reset to initial state */
|
|
170
|
+
reset: () => void;
|
|
171
|
+
/** Whether a previous page is available */
|
|
172
|
+
canLoadPrevPage: boolean;
|
|
173
|
+
/** Whether a next page is available */
|
|
174
|
+
canLoadNextPage: boolean;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface UseExplorerPaginatedApiOptions {
|
|
178
|
+
/** Cache time-to-live in seconds */
|
|
179
|
+
ttl?: number;
|
|
180
|
+
/** Rows per page */
|
|
181
|
+
limit?: number;
|
|
182
|
+
/** Reverse records order to match default grid order */
|
|
183
|
+
autoReverseRecordsOrder?: boolean;
|
|
184
|
+
/** Default sort order */
|
|
185
|
+
defaultSortOrder?: 'asc' | 'desc';
|
|
186
|
+
/** Load last meaningful page if no results returned */
|
|
187
|
+
autoLoadLastPage?: boolean;
|
|
188
|
+
/** Include network prefix in the endpoint */
|
|
189
|
+
includeNetwork?: boolean;
|
|
190
|
+
/** Default query parameter values */
|
|
191
|
+
defaultQueryParams?: Record<string, any>;
|
|
192
|
+
/** Callback for post-processing fetched data */
|
|
193
|
+
dataProcessingCallback?: (records: any[]) => any[];
|
|
194
|
+
/** Auto-load on mount */
|
|
195
|
+
autoLoad?: boolean;
|
|
196
|
+
/** Update browser query string on navigation */
|
|
197
|
+
updateLocation?: boolean | ((params: Record<string, any>) => Record<string, any>);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** React hook for fetching paginated data from the Explorer API */
|
|
201
|
+
export function useExplorerPaginatedApi(
|
|
202
|
+
apiEndpoint: string | APIEndpointParams,
|
|
203
|
+
options?: UseExplorerPaginatedApiOptions,
|
|
204
|
+
dependencies?: any[]
|
|
205
|
+
): ExplorerApiListResponse;
|
|
206
|
+
|
|
207
|
+
/** Load a single transaction by hash or ID */
|
|
208
|
+
export function loadTransaction(txHashOrId: string): Promise<any>;
|
|
209
|
+
|
|
210
|
+
/** Load all transactions for a given ledger sequence */
|
|
211
|
+
export function loadLedgerTransactions(sequence: number): Promise<any[]>;
|
|
212
|
+
|
|
213
|
+
/** Batches multiple load requests into single API calls */
|
|
214
|
+
export class ExplorerBatchInfoLoader {
|
|
215
|
+
constructor(
|
|
216
|
+
fetchCallback: (keys: string[]) => Promise<any>,
|
|
217
|
+
processResponseCallback: (entry: any) => { key: string; info: any }
|
|
218
|
+
);
|
|
219
|
+
/** Load a single entry by key (batched with other pending requests) */
|
|
220
|
+
loadEntry(key: string): Promise<any>;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/** Singleton ledger stream for subscribing to new ledger notifications */
|
|
224
|
+
export const ledgerStream: {
|
|
225
|
+
/** Subscribe to new ledger events */
|
|
226
|
+
on(listener: (ledger: number) => void): void;
|
|
227
|
+
/** Unsubscribe from ledger events */
|
|
228
|
+
off(listener: (ledger: number) => void): void;
|
|
229
|
+
/** Fetch the most recent ledger info */
|
|
230
|
+
getLast(): Promise<any>;
|
|
231
|
+
/** Fetch the sequence number of the most recent ledger */
|
|
232
|
+
getLastSequence(): Promise<number>;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
// ============================================================================
|
|
236
|
+
// Horizon API
|
|
237
|
+
// ============================================================================
|
|
238
|
+
|
|
239
|
+
export interface ParsedStellarId {
|
|
240
|
+
type: 'unknown' | 'ledger' | 'transaction' | 'operation';
|
|
241
|
+
id?: string;
|
|
242
|
+
ledger?: number;
|
|
243
|
+
tx?: string;
|
|
244
|
+
operationOrder?: number;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** Parse a Stellar generic ID into its components */
|
|
248
|
+
export function parseStellarGenericId(id: string): ParsedStellarId;
|
|
249
|
+
|
|
250
|
+
export interface ListQueryParams {
|
|
251
|
+
cursor?: string;
|
|
252
|
+
order?: 'asc' | 'desc';
|
|
253
|
+
limit?: number;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** Initialize a Horizon server instance */
|
|
257
|
+
export function initHorizon(): any;
|
|
258
|
+
|
|
259
|
+
/** Load all records from a Horizon query using pagination */
|
|
260
|
+
export function loadAllHorizonRecords(query: any): Promise<{ records: any[] }>;
|
|
261
|
+
|
|
262
|
+
/** Apply cursor, order, and limit to a Horizon query builder */
|
|
263
|
+
export function applyListQueryParameters(query: any, queryParameters?: ListQueryParams): any;
|
|
264
|
+
|
|
265
|
+
/** Load ledgers from Horizon */
|
|
266
|
+
export function loadLedgers(queryParams?: ListQueryParams): Promise<any[]>;
|
|
267
|
+
|
|
268
|
+
/** Load a single ledger by sequence number */
|
|
269
|
+
export function loadLedger(sequence: number): Promise<any>;
|
|
270
|
+
|
|
271
|
+
/** Stream new ledgers from Horizon */
|
|
272
|
+
export function streamLedgers(cursor: string, onNewLedger: (ledger: any) => void): () => void;
|
|
273
|
+
|
|
274
|
+
/** Load transactions from Horizon */
|
|
275
|
+
export function loadTransactions(queryParams?: ListQueryParams): Promise<any[]>;
|
|
276
|
+
|
|
277
|
+
/** Stream new transactions from Horizon */
|
|
278
|
+
export function streamTransactions(cursor: string, onNewTx: (tx: any) => void, includeFailed?: boolean): () => void;
|
|
279
|
+
|
|
280
|
+
/** Submit a transaction to the Stellar network */
|
|
281
|
+
export function submitTransaction(tx: any): Promise<any>;
|
|
282
|
+
|
|
283
|
+
/** Load account details from Horizon */
|
|
284
|
+
export function loadAccount(accountAddress: string): Promise<any>;
|
|
285
|
+
|
|
286
|
+
/** Load assets issued by an account */
|
|
287
|
+
export function loadIssuedAssets(account: string, queryParams?: ListQueryParams): Promise<any[]>;
|
|
288
|
+
|
|
289
|
+
/** Load active offers for an account */
|
|
290
|
+
export function loadAccountOffers(account: string, queryParams?: ListQueryParams): Promise<any[]>;
|
|
291
|
+
|
|
292
|
+
/** Load claimable balances for an account */
|
|
293
|
+
export function loadAccountClaimableBalances(account: string): Promise<any[]>;
|
|
294
|
+
|
|
295
|
+
/** Get the lock status of an account */
|
|
296
|
+
export function getAccountLockStatus(account: any): 'unlocked' | 'locked' | 'partially locked';
|
|
297
|
+
|
|
298
|
+
/** Get balance details for an account */
|
|
299
|
+
export function getAccountBalance(account: any, asset?: { code: string; issuer?: string }): {
|
|
300
|
+
total: string;
|
|
301
|
+
available: string;
|
|
302
|
+
asset: any;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
/** Load orderbook from Horizon */
|
|
306
|
+
export function loadOrderbook(selling: any, buying: any, queryParams?: ListQueryParams): Promise<any[]>;
|
|
307
|
+
|
|
308
|
+
/** Load recent trades for a market pair */
|
|
309
|
+
export function loadMarketTrades(baseAsset: any, counterAsset: any, queryParams?: ListQueryParams): Promise<any[]>;
|
|
310
|
+
|
|
311
|
+
/** Stream new trades for a market pair */
|
|
312
|
+
export function streamMarketTrades(cursor: string, baseAsset: any, counterAsset: any, onNewTrade: (trade: any) => void): () => void;
|
|
313
|
+
|
|
314
|
+
/** Stream all trades */
|
|
315
|
+
export function streamTrades(cursor: string, onNewTrade: (trade: any) => void): () => void;
|
|
316
|
+
|
|
317
|
+
/** Load trade aggregation data */
|
|
318
|
+
export function loadTradesAggregation(params: {
|
|
319
|
+
base: any;
|
|
320
|
+
counter: any;
|
|
321
|
+
resolution: number;
|
|
322
|
+
period: number;
|
|
323
|
+
limit?: number;
|
|
324
|
+
}): Promise<any>;
|
|
325
|
+
|
|
326
|
+
// ============================================================================
|
|
327
|
+
// UI Controls
|
|
328
|
+
// ============================================================================
|
|
329
|
+
|
|
330
|
+
export interface ButtonProps {
|
|
331
|
+
/** Link URL; renders as <a> tag when set */
|
|
332
|
+
href?: string;
|
|
333
|
+
/** Click handler */
|
|
334
|
+
onClick?: React.MouseEventHandler;
|
|
335
|
+
/** Render as block-level element */
|
|
336
|
+
block?: boolean;
|
|
337
|
+
/** Outline style instead of filled */
|
|
338
|
+
outline?: boolean;
|
|
339
|
+
/** Text-only, no outline */
|
|
340
|
+
clear?: boolean;
|
|
341
|
+
/** Stack buttons on mobile */
|
|
342
|
+
stackable?: boolean;
|
|
343
|
+
/** Smaller button */
|
|
344
|
+
small?: boolean;
|
|
345
|
+
/** Disable the button */
|
|
346
|
+
disabled?: boolean;
|
|
347
|
+
/** Show loading animation */
|
|
348
|
+
loading?: boolean;
|
|
349
|
+
/** Additional CSS classes */
|
|
350
|
+
className?: string;
|
|
351
|
+
/** Tooltip text */
|
|
352
|
+
title?: string;
|
|
353
|
+
/** Button content */
|
|
354
|
+
children: React.ReactNode;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export const Button: React.FC<ButtonProps>;
|
|
358
|
+
|
|
359
|
+
export interface ButtonGroupProps {
|
|
360
|
+
/** Render as inline element */
|
|
361
|
+
inline?: boolean;
|
|
362
|
+
/** Nested buttons */
|
|
363
|
+
children: React.ReactNode;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export const ButtonGroup: React.FC<ButtonGroupProps>;
|
|
367
|
+
|
|
368
|
+
export interface InfoTooltipProps {
|
|
369
|
+
/** Tooltip content */
|
|
370
|
+
children: React.ReactNode;
|
|
371
|
+
/** Optional "Read more" link URL */
|
|
372
|
+
link?: string;
|
|
373
|
+
/** Icon CSS class */
|
|
374
|
+
icon?: string;
|
|
375
|
+
[key: string]: any;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export const InfoTooltip: React.FC<InfoTooltipProps>;
|
|
379
|
+
|
|
380
|
+
export interface TooltipProps {
|
|
381
|
+
/** Element that triggers the tooltip */
|
|
382
|
+
trigger: React.ReactElement;
|
|
383
|
+
/** Preferred tooltip position */
|
|
384
|
+
desiredPlace?: 'top' | 'bottom' | 'left' | 'right';
|
|
385
|
+
/** Position offset */
|
|
386
|
+
offset?: { top?: number; bottom?: number; left?: number; right?: number };
|
|
387
|
+
/** Activation mode */
|
|
388
|
+
activation?: 'hover' | 'click';
|
|
389
|
+
/** Maximum width of the tooltip */
|
|
390
|
+
maxWidth?: string;
|
|
391
|
+
/** Tooltip content */
|
|
392
|
+
children?: React.ReactNode;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export const Tooltip: React.FC<TooltipProps>;
|
|
396
|
+
|
|
397
|
+
export interface UpdateHighlighterProps {
|
|
398
|
+
/** Content to highlight on change */
|
|
399
|
+
children: React.ReactNode;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export const UpdateHighlighter: React.FC<UpdateHighlighterProps>;
|
|
403
|
+
|
|
404
|
+
export interface TabDescriptor {
|
|
405
|
+
/** Unique tab identifier */
|
|
406
|
+
name: string;
|
|
407
|
+
/** Display title */
|
|
408
|
+
title?: string;
|
|
409
|
+
/** Render callback for tab content */
|
|
410
|
+
render?: () => React.ReactNode;
|
|
411
|
+
/** Whether this is the default tab */
|
|
412
|
+
isDefault?: boolean;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export interface TabsProps {
|
|
416
|
+
/** Tab definitions */
|
|
417
|
+
tabs: TabDescriptor[];
|
|
418
|
+
/** Currently selected tab name */
|
|
419
|
+
selectedTab?: string;
|
|
420
|
+
/** Tab change handler */
|
|
421
|
+
onChange?: (tabName: string) => void;
|
|
422
|
+
/** Query parameter name for URL sync */
|
|
423
|
+
queryParam?: string;
|
|
424
|
+
/** Additional CSS classes */
|
|
425
|
+
className?: string;
|
|
426
|
+
/** Align tabs to the right */
|
|
427
|
+
right?: boolean;
|
|
428
|
+
/** Additional header content */
|
|
429
|
+
children?: React.ReactNode;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export function Tabs(props: TabsProps): React.ReactElement;
|
|
433
|
+
|
|
434
|
+
export interface DropdownOption {
|
|
435
|
+
/** Internal value for identification */
|
|
436
|
+
value?: string | number;
|
|
437
|
+
/** Link URL for menu-style items */
|
|
438
|
+
href?: string;
|
|
439
|
+
/** Display title */
|
|
440
|
+
title?: any;
|
|
441
|
+
/** Additional CSS class */
|
|
442
|
+
className?: string;
|
|
443
|
+
/** Whether the option is disabled */
|
|
444
|
+
disabled?: boolean;
|
|
445
|
+
/** Whether to hide the option */
|
|
446
|
+
hidden?: boolean;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export interface DropdownProps {
|
|
450
|
+
/** Available options */
|
|
451
|
+
options: Array<DropdownOption | string>;
|
|
452
|
+
/** Currently selected value */
|
|
453
|
+
value?: string | number;
|
|
454
|
+
/** Title to display instead of the selected value */
|
|
455
|
+
title?: any;
|
|
456
|
+
/** Disable the dropdown */
|
|
457
|
+
disabled?: boolean;
|
|
458
|
+
/** Additional CSS classes */
|
|
459
|
+
className?: string;
|
|
460
|
+
/** Selection change handler */
|
|
461
|
+
onChange?: (value: any) => void;
|
|
462
|
+
/** HTML title attribute */
|
|
463
|
+
hint?: string;
|
|
464
|
+
/** Show toggle arrow icon */
|
|
465
|
+
showToggle?: boolean;
|
|
466
|
+
/** Centered dialog overlay mode */
|
|
467
|
+
solo?: boolean;
|
|
468
|
+
/** Hide selected item from the list */
|
|
469
|
+
hideSelected?: boolean;
|
|
470
|
+
/** Optional list header */
|
|
471
|
+
header?: React.ReactNode;
|
|
472
|
+
/** Optional list footer */
|
|
473
|
+
footer?: React.ReactNode;
|
|
474
|
+
/** Initially open */
|
|
475
|
+
expanded?: boolean;
|
|
476
|
+
/** Scroll handler for infinite scroll */
|
|
477
|
+
onScroll?: (info: { position: number; rel: 'top' | 'middle' | 'bottom' }) => void;
|
|
478
|
+
/** Handler when dropdown opens */
|
|
479
|
+
onOpen?: () => void;
|
|
480
|
+
/** Handler when dropdown closes */
|
|
481
|
+
onClose?: () => void;
|
|
482
|
+
/** Maximum list height */
|
|
483
|
+
maxHeight?: string;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export const Dropdown: React.FC<DropdownProps>;
|
|
487
|
+
|
|
488
|
+
export interface CodeBlockProps {
|
|
489
|
+
/** Source code text */
|
|
490
|
+
children: string;
|
|
491
|
+
/** Language for syntax highlighting */
|
|
492
|
+
lang?: 'js' | 'json' | 'html' | 'xml' | 'toml' | 'rust' | 'plain';
|
|
493
|
+
/** Additional CSS classes */
|
|
494
|
+
className?: string;
|
|
495
|
+
/** Inline styles */
|
|
496
|
+
style?: React.CSSProperties;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
export const CodeBlock: React.FC<CodeBlockProps>;
|
|
500
|
+
|
|
501
|
+
export interface SliderProps {
|
|
502
|
+
/** Current value */
|
|
503
|
+
value?: number;
|
|
504
|
+
/** Category labels */
|
|
505
|
+
categories?: string[];
|
|
506
|
+
/** Value change handler (throttled) */
|
|
507
|
+
onChange?: (value: number) => void;
|
|
508
|
+
/** Minimum value */
|
|
509
|
+
min?: number;
|
|
510
|
+
/** Maximum value */
|
|
511
|
+
max?: number;
|
|
512
|
+
/** Step increment */
|
|
513
|
+
step?: number;
|
|
514
|
+
[key: string]: any;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
export function Slider(props: SliderProps): React.ReactElement;
|
|
518
|
+
|
|
519
|
+
export interface ExternalLinkProps {
|
|
520
|
+
/** Link URL */
|
|
521
|
+
href: string;
|
|
522
|
+
/** Link content */
|
|
523
|
+
children?: React.ReactNode;
|
|
524
|
+
[key: string]: any;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
export const ExternalLink: React.FC<ExternalLinkProps>;
|
|
528
|
+
|
|
529
|
+
// ============================================================================
|
|
530
|
+
// Toast Notifications
|
|
531
|
+
// ============================================================================
|
|
532
|
+
|
|
533
|
+
/** Initialize toast notifications container and expose window.notify() */
|
|
534
|
+
export function createToastNotificationsContainer(): HTMLDivElement;
|
|
535
|
+
|
|
536
|
+
// ============================================================================
|
|
537
|
+
// Error Handling
|
|
538
|
+
// ============================================================================
|
|
539
|
+
|
|
540
|
+
export interface ErrorBoundaryProps {
|
|
541
|
+
/** Title displayed in the error UI */
|
|
542
|
+
errorBoundaryTitle?: string;
|
|
543
|
+
/** Show "contact support" link */
|
|
544
|
+
errorBoundarySendErrors?: boolean;
|
|
545
|
+
/** Show error details (true), hide (false), or custom content */
|
|
546
|
+
errorBoundaryErrorDetails?: boolean | React.ReactNode;
|
|
547
|
+
children?: React.ReactNode;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export class ErrorBoundary extends React.Component<ErrorBoundaryProps> {}
|
|
551
|
+
|
|
552
|
+
/** Wrap a component with an ErrorBoundary */
|
|
553
|
+
export function withErrorBoundary<P extends object>(
|
|
554
|
+
wrapped: React.ComponentType<P>,
|
|
555
|
+
options?: {
|
|
556
|
+
errorBoundaryTitle?: string;
|
|
557
|
+
errorBoundarySendErrors?: boolean;
|
|
558
|
+
errorBoundaryErrorDetails?: boolean | React.ReactNode;
|
|
559
|
+
}
|
|
560
|
+
): React.FC<P>;
|
|
561
|
+
|
|
562
|
+
// ============================================================================
|
|
563
|
+
// Interaction
|
|
564
|
+
// ============================================================================
|
|
565
|
+
|
|
566
|
+
/** Auto-focus ref callback; focuses the element after a short delay */
|
|
567
|
+
export function useAutoFocusRef(inputRef: HTMLElement | null): void;
|
|
568
|
+
|
|
569
|
+
export interface BlockSelectProps {
|
|
570
|
+
/** HTML tag to render */
|
|
571
|
+
as?: string;
|
|
572
|
+
/** Content */
|
|
573
|
+
children: React.ReactNode;
|
|
574
|
+
/** HTML title */
|
|
575
|
+
title?: string;
|
|
576
|
+
/** Additional CSS classes */
|
|
577
|
+
className?: string;
|
|
578
|
+
/** Enable or disable text wrapping */
|
|
579
|
+
wrap?: boolean;
|
|
580
|
+
/** Force inline display */
|
|
581
|
+
inline?: boolean;
|
|
582
|
+
/** Inline styles */
|
|
583
|
+
style?: React.CSSProperties;
|
|
584
|
+
[key: string]: any;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
export const BlockSelect: React.FC<BlockSelectProps>;
|
|
588
|
+
|
|
589
|
+
export interface CopyToClipboardProps {
|
|
590
|
+
/** Text to copy */
|
|
591
|
+
text: string;
|
|
592
|
+
/** Custom trigger element (defaults to copy icon) */
|
|
593
|
+
children?: React.ReactNode;
|
|
594
|
+
/** Tooltip text */
|
|
595
|
+
title?: string;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export const CopyToClipboard: React.FC<CopyToClipboardProps>;
|
|
599
|
+
|
|
600
|
+
export interface SpoilerProps {
|
|
601
|
+
/** Initially expanded */
|
|
602
|
+
expanded?: boolean;
|
|
603
|
+
/** Label for expand action */
|
|
604
|
+
showMore?: string;
|
|
605
|
+
/** Label for collapse action */
|
|
606
|
+
showLess?: string;
|
|
607
|
+
/** Toggle callback */
|
|
608
|
+
onChange?: (state: { expanded: boolean }) => void;
|
|
609
|
+
/** Additional CSS classes */
|
|
610
|
+
className?: string;
|
|
611
|
+
/** Icon-only mode */
|
|
612
|
+
micro?: boolean;
|
|
613
|
+
/** Inline styles */
|
|
614
|
+
style?: React.CSSProperties;
|
|
615
|
+
/** Highlight the toggle link */
|
|
616
|
+
active?: boolean;
|
|
617
|
+
/** Content revealed when expanded */
|
|
618
|
+
children?: React.ReactNode;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
export const Spoiler: React.FC<SpoilerProps>;
|
|
622
|
+
|
|
623
|
+
export interface AccordionOption {
|
|
624
|
+
/** Unique key (falls back to title) */
|
|
625
|
+
key?: string;
|
|
626
|
+
/** Panel header content */
|
|
627
|
+
title: string | React.ReactNode;
|
|
628
|
+
/** Panel body content */
|
|
629
|
+
content: React.ReactNode;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export interface AccordionProps {
|
|
633
|
+
/** Panel definitions */
|
|
634
|
+
options: AccordionOption[];
|
|
635
|
+
/** Prefix for collapsed panels */
|
|
636
|
+
collapsedSymbol?: string;
|
|
637
|
+
/** Prefix for the expanded panel */
|
|
638
|
+
expandedSymbol?: string;
|
|
639
|
+
[key: string]: any;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export function Accordion(props: AccordionProps): React.ReactElement;
|
|
643
|
+
|
|
644
|
+
/** Theme toggle button (day/night) */
|
|
645
|
+
export const ThemeSelector: React.FC;
|
|
646
|
+
|
|
647
|
+
export interface InlineProgressProps {
|
|
648
|
+
/** Maximum number of dots */
|
|
649
|
+
dots?: number;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
export const InlineProgress: React.FC<InlineProgressProps>;
|
|
653
|
+
|
|
654
|
+
/** React hook that measures and tracks window width */
|
|
655
|
+
export function useWindowWidth(): number;
|
|
656
|
+
|
|
657
|
+
export interface QrCodeProps {
|
|
658
|
+
/** Value to encode */
|
|
659
|
+
value: string;
|
|
660
|
+
/** Caption under the QR code */
|
|
661
|
+
caption?: string;
|
|
662
|
+
/** QR code size in pixels */
|
|
663
|
+
size?: number;
|
|
664
|
+
/** Logo image URL to embed in the center */
|
|
665
|
+
embeddedImage?: string;
|
|
666
|
+
/** Embedded logo size */
|
|
667
|
+
embeddedSize?: number;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
export const QrCode: React.FC<QrCodeProps>;
|
|
671
|
+
|
|
672
|
+
export interface DialogProps {
|
|
673
|
+
/** Whether the dialog is open */
|
|
674
|
+
dialogOpen?: boolean;
|
|
675
|
+
/** Dialog content */
|
|
676
|
+
children?: React.ReactNode;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
export const Dialog: React.FC<DialogProps>;
|
|
680
|
+
|
|
681
|
+
/** Replaces built-in alert() and confirm() with styled dialogs */
|
|
682
|
+
export const SystemDialog: React.FC;
|
|
683
|
+
|
|
684
|
+
// ============================================================================
|
|
685
|
+
// Date Components
|
|
686
|
+
// ============================================================================
|
|
687
|
+
|
|
688
|
+
export interface UtcTimestampProps {
|
|
689
|
+
/** Timestamp to display */
|
|
690
|
+
date: string | number | Date;
|
|
691
|
+
/** Show date only without time */
|
|
692
|
+
dateOnly?: boolean;
|
|
693
|
+
/** Additional CSS classes */
|
|
694
|
+
className?: string;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
export const UtcTimestamp: React.FC<UtcTimestampProps>;
|
|
698
|
+
|
|
699
|
+
export interface ElapsedTimeProps {
|
|
700
|
+
/** Timestamp to measure elapsed time from */
|
|
701
|
+
ts: Date | string | number;
|
|
702
|
+
/** Additional CSS classes */
|
|
703
|
+
className?: string;
|
|
704
|
+
/** Text appended after the time (e.g., " ago") */
|
|
705
|
+
suffix?: string;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
export const ElapsedTime: React.FC<ElapsedTimeProps>;
|
|
709
|
+
|
|
710
|
+
export interface DateSelectorProps {
|
|
711
|
+
/** Current date value */
|
|
712
|
+
value?: string | number | Date;
|
|
713
|
+
/** Change handler (receives Unix timestamp or null) */
|
|
714
|
+
onChange?: (value: number | null) => void;
|
|
715
|
+
/** Minimum selectable date */
|
|
716
|
+
min?: string;
|
|
717
|
+
/** Maximum selectable date */
|
|
718
|
+
max?: string;
|
|
719
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
720
|
+
[key: string]: any;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
export function DateSelector(props: DateSelectorProps): React.ReactElement;
|
|
724
|
+
|
|
725
|
+
/** Trim seconds from an ISO date string */
|
|
726
|
+
export function trimIsoDateSeconds(date: Date | number): string;
|
|
727
|
+
|
|
728
|
+
// ============================================================================
|
|
729
|
+
// Ledger Components
|
|
730
|
+
// ============================================================================
|
|
731
|
+
|
|
732
|
+
export interface TxLinkProps {
|
|
733
|
+
/** Transaction hash */
|
|
734
|
+
tx: string;
|
|
735
|
+
/** Stellar network override */
|
|
736
|
+
network?: string;
|
|
737
|
+
/** Custom link content */
|
|
738
|
+
children?: React.ReactNode;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
export const TxLink: React.FC<TxLinkProps>;
|
|
742
|
+
|
|
743
|
+
export interface OpLinkProps {
|
|
744
|
+
/** Operation ID */
|
|
745
|
+
op: string;
|
|
746
|
+
/** Stellar network override */
|
|
747
|
+
network?: string;
|
|
748
|
+
children?: React.ReactNode;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
export const OpLink: React.FC<OpLinkProps>;
|
|
752
|
+
|
|
753
|
+
export interface LedgerLinkProps {
|
|
754
|
+
/** Ledger sequence number */
|
|
755
|
+
sequence: number;
|
|
756
|
+
/** Stellar network override */
|
|
757
|
+
network?: string;
|
|
758
|
+
children?: React.ReactNode;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
export const LedgerLink: React.FC<LedgerLinkProps>;
|
|
762
|
+
|
|
763
|
+
export interface OfferLinkProps {
|
|
764
|
+
/** Offer ID */
|
|
765
|
+
offer: string;
|
|
766
|
+
/** Stellar network override */
|
|
767
|
+
network?: string;
|
|
768
|
+
children?: React.ReactNode;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
export const OfferLink: React.FC<OfferLinkProps>;
|
|
772
|
+
|
|
773
|
+
export interface PoolLinkProps {
|
|
774
|
+
/** Pool ID */
|
|
775
|
+
pool: string;
|
|
776
|
+
/** Stellar network override */
|
|
777
|
+
network?: string;
|
|
778
|
+
children?: React.ReactNode;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
export const PoolLink: React.FC<PoolLinkProps>;
|
|
782
|
+
|
|
783
|
+
/** Generate an explorer link URL */
|
|
784
|
+
export function formatExplorerLink(
|
|
785
|
+
type: 'account' | 'asset' | 'ledger' | 'tx' | 'op' | 'offer' | 'contract' | 'liquidity-pool' | 'claimable-balance',
|
|
786
|
+
id: string | number,
|
|
787
|
+
network?: string
|
|
788
|
+
): string;
|
|
789
|
+
|
|
790
|
+
export interface LedgerInfo {
|
|
791
|
+
sequence: number;
|
|
792
|
+
ts: number;
|
|
793
|
+
protocol: number;
|
|
794
|
+
operations: number;
|
|
795
|
+
failedOperations: number;
|
|
796
|
+
txSuccess: number;
|
|
797
|
+
txFailed: number;
|
|
798
|
+
xlm: bigint;
|
|
799
|
+
feePool: bigint;
|
|
800
|
+
baseFee: number;
|
|
801
|
+
baseReserve: number;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/** Parse raw ledger data including XDR header */
|
|
805
|
+
export function retrieveLedgerInfo(data: {
|
|
806
|
+
xdr: string;
|
|
807
|
+
sequence: number;
|
|
808
|
+
ts: number;
|
|
809
|
+
protocol: number;
|
|
810
|
+
successful_operations?: number;
|
|
811
|
+
failed_operations?: number;
|
|
812
|
+
successful_transactions?: number;
|
|
813
|
+
failed_transactions?: number;
|
|
814
|
+
}): LedgerInfo;
|
|
815
|
+
|
|
816
|
+
// ============================================================================
|
|
817
|
+
// Account Components
|
|
818
|
+
// ============================================================================
|
|
819
|
+
|
|
820
|
+
/** Generate an SVG identicon for a Stellar address */
|
|
821
|
+
export function drawIdenticon(address: string, size?: number): string;
|
|
822
|
+
|
|
823
|
+
export interface AccountIdenticonProps {
|
|
824
|
+
/** StrKey-encoded account address */
|
|
825
|
+
address: string;
|
|
826
|
+
/** Identicon display size */
|
|
827
|
+
size?: number;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
export const AccountIdenticon: React.FC<AccountIdenticonProps>;
|
|
831
|
+
|
|
832
|
+
export interface AccountAddressProps {
|
|
833
|
+
/** StrKey-encoded account/contract address */
|
|
834
|
+
account: string;
|
|
835
|
+
/** Visible character count (number or "all") */
|
|
836
|
+
chars?: number | 'all';
|
|
837
|
+
/** Explicit display name; false to hide */
|
|
838
|
+
name?: string | false;
|
|
839
|
+
/** Explicit link URL; false to disable linking */
|
|
840
|
+
link?: string | false;
|
|
841
|
+
/** Inline styles */
|
|
842
|
+
style?: React.CSSProperties;
|
|
843
|
+
/** Additional CSS classes */
|
|
844
|
+
className?: string;
|
|
845
|
+
/** Show/hide identicon */
|
|
846
|
+
icon?: boolean;
|
|
847
|
+
/** Prefix content */
|
|
848
|
+
prefix?: React.ReactNode;
|
|
849
|
+
/** Suffix content */
|
|
850
|
+
suffix?: React.ReactNode;
|
|
851
|
+
/** Stellar network override */
|
|
852
|
+
network?: string;
|
|
853
|
+
[key: string]: any;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
export const AccountAddress: React.FC<AccountAddressProps>;
|
|
857
|
+
|
|
858
|
+
export interface SignerKeyProps {
|
|
859
|
+
/** Signer object (raw XDR or parsed) */
|
|
860
|
+
signer: any;
|
|
861
|
+
/** Explicit display name */
|
|
862
|
+
name?: string;
|
|
863
|
+
/** Additional CSS classes */
|
|
864
|
+
className?: string;
|
|
865
|
+
/** Show signer weight */
|
|
866
|
+
showWeight?: boolean;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
export const SignerKey: React.FC<SignerKeyProps>;
|
|
870
|
+
|
|
871
|
+
/** Calculate available balance for an account trustline */
|
|
872
|
+
export function calculateAvailableBalance(
|
|
873
|
+
account: any,
|
|
874
|
+
balance: any,
|
|
875
|
+
additionalReserves?: number | null,
|
|
876
|
+
decimals?: number
|
|
877
|
+
): string;
|
|
878
|
+
|
|
879
|
+
// ============================================================================
|
|
880
|
+
// Asset Components
|
|
881
|
+
// ============================================================================
|
|
882
|
+
|
|
883
|
+
export interface AssetLinkProps {
|
|
884
|
+
/** Asset descriptor (string, AssetDescriptor, or Asset) */
|
|
885
|
+
asset: string | any;
|
|
886
|
+
/** Link URL or false to disable */
|
|
887
|
+
link?: string | false;
|
|
888
|
+
/** Show asset issuer */
|
|
889
|
+
issuer?: boolean;
|
|
890
|
+
/** Show asset icon */
|
|
891
|
+
icon?: boolean;
|
|
892
|
+
/** Additional CSS classes */
|
|
893
|
+
className?: string;
|
|
894
|
+
/** Inline styles */
|
|
895
|
+
style?: React.CSSProperties;
|
|
896
|
+
/** Custom inner content */
|
|
897
|
+
children?: React.ReactNode;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
export const AssetLink: React.FC<AssetLinkProps>;
|
|
901
|
+
|
|
902
|
+
export interface AssetIssuerProps {
|
|
903
|
+
/** Asset descriptor */
|
|
904
|
+
asset: string | any;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
export const AssetIssuer: React.FC<AssetIssuerProps>;
|
|
908
|
+
|
|
909
|
+
export interface AssetIconProps {
|
|
910
|
+
/** Asset descriptor */
|
|
911
|
+
asset: string | any;
|
|
912
|
+
/** Additional CSS classes */
|
|
913
|
+
className?: string;
|
|
914
|
+
/** Inline styles */
|
|
915
|
+
style?: React.CSSProperties;
|
|
916
|
+
/** Inner content */
|
|
917
|
+
children?: React.ReactNode;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
export const AssetIcon: React.FC<AssetIconProps>;
|
|
921
|
+
|
|
922
|
+
export interface AssetSelectorProps {
|
|
923
|
+
/** Selection change callback */
|
|
924
|
+
onChange: (value: string) => void;
|
|
925
|
+
/** Currently selected asset */
|
|
926
|
+
value?: string;
|
|
927
|
+
/** Predefined assets shown at top of list */
|
|
928
|
+
predefinedAssets?: string[];
|
|
929
|
+
/** Restrict to predefined assets only */
|
|
930
|
+
restricted?: boolean;
|
|
931
|
+
/** Dropdown title */
|
|
932
|
+
title?: string;
|
|
933
|
+
/** Initially expanded */
|
|
934
|
+
expanded?: boolean;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
export function AssetSelector(props: AssetSelectorProps): React.ReactElement;
|
|
938
|
+
|
|
939
|
+
export interface AmountProps {
|
|
940
|
+
/** Token amount */
|
|
941
|
+
amount: string | number;
|
|
942
|
+
/** Asset descriptor */
|
|
943
|
+
asset?: string | any;
|
|
944
|
+
/** Number of decimal places (or "auto") */
|
|
945
|
+
decimals?: number | 'auto';
|
|
946
|
+
/** Treat amount as raw Int64 stroops */
|
|
947
|
+
adjust?: boolean;
|
|
948
|
+
/** Round the amount */
|
|
949
|
+
round?: boolean | 'floor';
|
|
950
|
+
/** Show asset issuer */
|
|
951
|
+
issuer?: boolean;
|
|
952
|
+
/** Show asset icon */
|
|
953
|
+
icon?: boolean;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
export const Amount: React.FC<AmountProps>;
|
|
957
|
+
|
|
958
|
+
export interface AssetBasicTomlInfo {
|
|
959
|
+
name?: string;
|
|
960
|
+
orgName?: string;
|
|
961
|
+
image?: string;
|
|
962
|
+
decimals?: number;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
export interface AssetMeta {
|
|
966
|
+
name?: string;
|
|
967
|
+
domain?: string;
|
|
968
|
+
toml_info?: AssetBasicTomlInfo;
|
|
969
|
+
decimals?: number;
|
|
970
|
+
code?: string;
|
|
971
|
+
tokenName?: string;
|
|
972
|
+
unsafe?: boolean;
|
|
973
|
+
[key: string]: any;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
/** React hook that fetches and returns asset metadata */
|
|
977
|
+
export function useAssetMeta(asset: string | any): AssetMeta | null;
|
|
978
|
+
|
|
979
|
+
/** React hook for fetching a paginated asset list */
|
|
980
|
+
export function useAssetList(params?: Record<string, any>): {
|
|
981
|
+
assets: any[];
|
|
982
|
+
loadPage: () => void;
|
|
983
|
+
loading: boolean;
|
|
984
|
+
};
|
|
985
|
+
|
|
986
|
+
// ============================================================================
|
|
987
|
+
// Claimable Balance
|
|
988
|
+
// ============================================================================
|
|
989
|
+
|
|
990
|
+
export interface ClaimableBalanceClaimantsProps {
|
|
991
|
+
/** Array of claimant objects */
|
|
992
|
+
claimants: any[];
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
export const ClaimableBalanceClaimants: React.FC<ClaimableBalanceClaimantsProps>;
|
|
996
|
+
|
|
997
|
+
// ============================================================================
|
|
998
|
+
// DEX
|
|
999
|
+
// ============================================================================
|
|
1000
|
+
|
|
1001
|
+
export interface PriceDynamicProps {
|
|
1002
|
+
/** Pre-calculated change percentage */
|
|
1003
|
+
change?: number;
|
|
1004
|
+
/** Current price */
|
|
1005
|
+
current?: number;
|
|
1006
|
+
/** Previous price */
|
|
1007
|
+
prev?: number;
|
|
1008
|
+
/** Standalone styling */
|
|
1009
|
+
standalone?: boolean;
|
|
1010
|
+
/** Show 0% instead of null */
|
|
1011
|
+
allowZero?: boolean;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
export const PriceDynamic: React.FC<PriceDynamicProps>;
|
|
1015
|
+
|
|
1016
|
+
// ============================================================================
|
|
1017
|
+
// Directory
|
|
1018
|
+
// ============================================================================
|
|
1019
|
+
|
|
1020
|
+
/** Fetch a directory entry for a Stellar address */
|
|
1021
|
+
export function getDirectoryEntry(
|
|
1022
|
+
address: string,
|
|
1023
|
+
options?: { forceRefresh?: boolean; extended?: boolean }
|
|
1024
|
+
): Promise<any | null>;
|
|
1025
|
+
|
|
1026
|
+
/** React hook that fetches directory info for an address */
|
|
1027
|
+
export function useDirectory(
|
|
1028
|
+
address: string,
|
|
1029
|
+
options?: { forceRefresh?: boolean }
|
|
1030
|
+
): any | null;
|
|
1031
|
+
|
|
1032
|
+
/** React hook that fetches all available directory tags */
|
|
1033
|
+
export function useDirectoryTags(): any[];
|
|
1034
|
+
|
|
1035
|
+
// ============================================================================
|
|
1036
|
+
// Transaction / Operations
|
|
1037
|
+
// ============================================================================
|
|
1038
|
+
|
|
1039
|
+
export interface TxOperationsListProps {
|
|
1040
|
+
/** Parsed transaction details */
|
|
1041
|
+
parsedTx: ParsedTxDetails;
|
|
1042
|
+
/** Filter function for operations */
|
|
1043
|
+
filter?: ((op: any, index: number) => boolean) | null;
|
|
1044
|
+
/** Show transaction fees */
|
|
1045
|
+
showFees?: boolean;
|
|
1046
|
+
/** Compact view mode */
|
|
1047
|
+
compact?: boolean;
|
|
1048
|
+
/** Show operation effects */
|
|
1049
|
+
showEffects?: boolean;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
export const TxOperationsList: React.FC<TxOperationsListProps>;
|
|
1053
|
+
|
|
1054
|
+
export interface TxFiltersContext {
|
|
1055
|
+
type?: string[];
|
|
1056
|
+
account?: string[];
|
|
1057
|
+
source?: string[];
|
|
1058
|
+
destination?: string[];
|
|
1059
|
+
asset?: string[];
|
|
1060
|
+
src_asset?: string[];
|
|
1061
|
+
dest_asset?: string[];
|
|
1062
|
+
offer?: string[];
|
|
1063
|
+
pool?: string[];
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
export interface ParsedTxDetails {
|
|
1067
|
+
/** Parsed operation descriptors */
|
|
1068
|
+
operations: any[];
|
|
1069
|
+
/** Parsed transaction */
|
|
1070
|
+
tx: any;
|
|
1071
|
+
/** Transaction hash */
|
|
1072
|
+
txHash: string;
|
|
1073
|
+
/** Filter context */
|
|
1074
|
+
context: any;
|
|
1075
|
+
/** Resolved context type */
|
|
1076
|
+
contextType: string;
|
|
1077
|
+
/** True if transaction has not been submitted */
|
|
1078
|
+
isEphemeral: boolean;
|
|
1079
|
+
/** Whether transaction matches context */
|
|
1080
|
+
unmatched: boolean;
|
|
1081
|
+
/** Whether the transaction was successful */
|
|
1082
|
+
successful?: boolean;
|
|
1083
|
+
/** Transaction-level effects */
|
|
1084
|
+
effects?: any[];
|
|
1085
|
+
/** Ledger application timestamp */
|
|
1086
|
+
createdAt?: string;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
/** Parse transaction details from raw XDR envelope, result, and meta */
|
|
1090
|
+
export function parseTxDetails(params: {
|
|
1091
|
+
/** Network passphrase */
|
|
1092
|
+
network: string;
|
|
1093
|
+
/** Base64-encoded transaction envelope XDR */
|
|
1094
|
+
txEnvelope: string;
|
|
1095
|
+
/** Base64-encoded transaction result */
|
|
1096
|
+
result?: string;
|
|
1097
|
+
/** Base64-encoded transaction meta */
|
|
1098
|
+
meta?: string;
|
|
1099
|
+
/** Transaction ID */
|
|
1100
|
+
id?: string;
|
|
1101
|
+
/** Filter context */
|
|
1102
|
+
context?: TxFiltersContext;
|
|
1103
|
+
/** Ledger execution timestamp */
|
|
1104
|
+
createdAt?: string;
|
|
1105
|
+
/** Skip unrelated operations */
|
|
1106
|
+
skipUnrelated?: boolean;
|
|
1107
|
+
/** Stellar protocol version */
|
|
1108
|
+
protocol?: number;
|
|
1109
|
+
}): ParsedTxDetails;
|
|
1110
|
+
|
|
1111
|
+
/** React hook for fetching paginated transaction history */
|
|
1112
|
+
export function useTxHistory(params: {
|
|
1113
|
+
/** Query filters */
|
|
1114
|
+
filters: Record<string, any>;
|
|
1115
|
+
/** Sort order */
|
|
1116
|
+
order?: 'asc' | 'desc';
|
|
1117
|
+
/** Rows per page */
|
|
1118
|
+
rows?: number;
|
|
1119
|
+
/** Update browser query string */
|
|
1120
|
+
updateLocation?: boolean;
|
|
1121
|
+
}): ExplorerApiListResponse;
|
|
1122
|
+
|
|
1123
|
+
/** React hook for fetching transaction details by ID or hash */
|
|
1124
|
+
export function useTxInfo(idOrHash: string): ExplorerApiResult;
|
|
1125
|
+
|
|
1126
|
+
// ============================================================================
|
|
1127
|
+
// Effects
|
|
1128
|
+
// ============================================================================
|
|
1129
|
+
|
|
1130
|
+
export interface EffectDescriptionProps {
|
|
1131
|
+
/** Parsed transaction effect */
|
|
1132
|
+
effect: { type: string; [key: string]: any };
|
|
1133
|
+
/** Parent operation context */
|
|
1134
|
+
operation?: any;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
export function EffectDescription(props: EffectDescriptionProps): React.ReactElement;
|
|
1138
|
+
|
|
1139
|
+
// ============================================================================
|
|
1140
|
+
// Contract / Soroban
|
|
1141
|
+
// ============================================================================
|
|
1142
|
+
|
|
1143
|
+
/** React hook for fetching contract information */
|
|
1144
|
+
export function useContractInfo(address: string): ExplorerApiResult;
|
|
1145
|
+
|
|
1146
|
+
/** Generate URL to download contract WASM source */
|
|
1147
|
+
export function generateContractSourceLink(hash: string): string;
|
|
1148
|
+
|
|
1149
|
+
/** React hook for fetching contract WASM binary */
|
|
1150
|
+
export function useContractSource(hash: string): ArrayBuffer | null | undefined;
|
|
1151
|
+
|
|
1152
|
+
export interface ScValProps {
|
|
1153
|
+
/** ScVal as base64 XDR, parsed object, or array */
|
|
1154
|
+
value: string | any;
|
|
1155
|
+
/** Internal nested rendering flag */
|
|
1156
|
+
nested?: boolean;
|
|
1157
|
+
/** Block-level indentation */
|
|
1158
|
+
indent?: boolean;
|
|
1159
|
+
/** Wrap maps/arrays with brackets */
|
|
1160
|
+
wrapObjects?: boolean;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
export const ScVal: React.FC<ScValProps>;
|
|
1164
|
+
|
|
1165
|
+
/** Parse a base64-encoded XDR ScVal string */
|
|
1166
|
+
export function parseScValValue(value: string): any;
|
|
1167
|
+
|
|
1168
|
+
export interface ScValStructProps {
|
|
1169
|
+
/** Enable block-level indentation */
|
|
1170
|
+
indent?: boolean;
|
|
1171
|
+
/** Nested content */
|
|
1172
|
+
children: React.ReactNode;
|
|
1173
|
+
/** Show comma separator when > 1 */
|
|
1174
|
+
separate?: number;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
export const ScValStruct: React.FC<ScValStructProps>;
|
|
1178
|
+
|
|
1179
|
+
/** Set of primitive ScVal type identifiers */
|
|
1180
|
+
export const primitiveTypes: Set<string>;
|
|
1181
|
+
|
|
1182
|
+
// ============================================================================
|
|
1183
|
+
// Stellar Utilities
|
|
1184
|
+
// ============================================================================
|
|
1185
|
+
|
|
1186
|
+
/** Decode a Stellar key into its type and components */
|
|
1187
|
+
export function decodeKeyType(key: string): {
|
|
1188
|
+
address: string;
|
|
1189
|
+
type: 'ed25519' | 'contract' | 'muxed' | 'hash' | 'tx' | 'signedPayload';
|
|
1190
|
+
muxedId?: bigint;
|
|
1191
|
+
publicKey?: string;
|
|
1192
|
+
payload?: string;
|
|
1193
|
+
} | null;
|
|
1194
|
+
|
|
1195
|
+
/** Parse a multiplexed account address */
|
|
1196
|
+
export function parseMuxedAccount(muxedAddress: string): {
|
|
1197
|
+
address: string;
|
|
1198
|
+
muxedId: bigint;
|
|
1199
|
+
};
|
|
1200
|
+
|
|
1201
|
+
/** Encode an address and ID into a multiplexed address */
|
|
1202
|
+
export function encodeMuxedAccount(address: string, muxedId: bigint): string;
|
|
1203
|
+
|
|
1204
|
+
/** Convert signature hint to a StrKey mask */
|
|
1205
|
+
export function signatureHintToMask(hint: Buffer): string;
|
|
1206
|
+
|
|
1207
|
+
/** Format signature hint for display */
|
|
1208
|
+
export function formatSignatureHint(hint: Buffer): string;
|
|
1209
|
+
|
|
1210
|
+
/** Check if a hint matches a specific key (note: function name has a typo) */
|
|
1211
|
+
export function singatureHintMatchesKey(hint: Buffer, key: string): boolean;
|
|
1212
|
+
|
|
1213
|
+
/** Find a key matching a signature hint */
|
|
1214
|
+
export function findKeyBySignatureHint(hint: Buffer, allKeys: string[]): string | null;
|
|
1215
|
+
|
|
1216
|
+
/** Find a transaction signature for a given signer key */
|
|
1217
|
+
export function findSignatureByKey(key: string, allSignatures?: any[]): any;
|
|
1218
|
+
|
|
1219
|
+
/** Find all keys matching a signature hint */
|
|
1220
|
+
export function findKeysBySignatureHint(signature: any, keys: string[]): string[];
|
|
1221
|
+
|
|
1222
|
+
// ============================================================================
|
|
1223
|
+
// Global Declarations
|
|
1224
|
+
// ============================================================================
|
|
1225
|
+
|
|
1226
|
+
declare global {
|
|
1227
|
+
interface Window {
|
|
1228
|
+
/** StellarExpert frontend origin URL */
|
|
1229
|
+
explorerFrontendOrigin: string;
|
|
1230
|
+
/** StellarExpert API origin URL */
|
|
1231
|
+
explorerApiOrigin: string;
|
|
1232
|
+
/** Stellar Horizon API origin URL */
|
|
1233
|
+
horizonOrigin: string;
|
|
1234
|
+
/** Show a toast notification (available after createToastNotificationsContainer) */
|
|
1235
|
+
notify: (params: { type: 'info' | 'success' | 'warning' | 'error'; message: string }) => void;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
var explorerFrontendOrigin: string;
|
|
1239
|
+
var explorerApiOrigin: string;
|
|
1240
|
+
var horizonOrigin: string;
|
|
1241
|
+
}
|