@tuwaio/nova-transactions 0.3.1 → 0.4.1
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/{TransactionsInfoModal-D7eykTZp.d.cts → TransactionsInfoModal-EKgcn7Ot.d.cts} +217 -8
- package/dist/{TransactionsInfoModal-D7eykTZp.d.ts → TransactionsInfoModal-EKgcn7Ot.d.ts} +217 -8
- package/dist/chunk-66O24XG2.cjs +2 -0
- package/dist/chunk-QNGBNGYN.js +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +336 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/providers/index.cjs +1 -1
- package/dist/providers/index.d.cts +2 -2
- package/dist/providers/index.d.ts +2 -2
- package/dist/providers/index.js +1 -1
- package/package.json +16 -16
- package/dist/chunk-IUJ7P7EE.cjs +0 -1
- package/dist/chunk-PUSPAQGZ.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ToastCloseButtonProps, DialogContent } from '@tuwaio/nova-core';
|
|
3
|
-
import { TransactionStatus, Transaction, TxAdapter, TransactionPool, ITxTrackingStore, InitialTransaction } from '@tuwaio/pulsar-core';
|
|
3
|
+
import { TransactionStatus, Transaction, TxAdapter, TransactionPool, TxInMemoryPagination, ITxTrackingStore, InitialTransaction } from '@tuwaio/pulsar-core';
|
|
4
4
|
import { ReactNode, ComponentType, JSX, ComponentPropsWithoutRef } from 'react';
|
|
5
5
|
import { OrbitAdapter, TuwaErrorState } from '@tuwaio/orbit-core';
|
|
6
6
|
import { ToastContainerProps, ToastContentProps } from 'react-toastify';
|
|
@@ -91,7 +91,7 @@ type NovaTransactionsLabels = {
|
|
|
91
91
|
/** Labels related to toast notifications. */
|
|
92
92
|
toast: {
|
|
93
93
|
/** Text for the button/link within a toast to open the wallet modal. */
|
|
94
|
-
|
|
94
|
+
openTransaction: string;
|
|
95
95
|
};
|
|
96
96
|
/** Standard labels for transaction statuses. */
|
|
97
97
|
statuses: {
|
|
@@ -189,6 +189,83 @@ type NovaTransactionsLabels = {
|
|
|
189
189
|
/** Text for a generic "Speed up" action. */
|
|
190
190
|
speedUp: string;
|
|
191
191
|
};
|
|
192
|
+
/** Labels for the detailed transaction view. */
|
|
193
|
+
transactionDetails: {
|
|
194
|
+
/** Main title for the detailed view. */
|
|
195
|
+
title: string;
|
|
196
|
+
/** Subtitle for the detailed view. */
|
|
197
|
+
subtitle: string;
|
|
198
|
+
/** Label for the metadata section. */
|
|
199
|
+
metadata: string;
|
|
200
|
+
/** Label for the execution data section. */
|
|
201
|
+
executionData: string;
|
|
202
|
+
/** Label for the adapter type. */
|
|
203
|
+
adapter: string;
|
|
204
|
+
/** Label for the submission time. */
|
|
205
|
+
submittedAt: string;
|
|
206
|
+
/** Label for the completion time. */
|
|
207
|
+
finishedAt: string;
|
|
208
|
+
/** Label for the tracker name. */
|
|
209
|
+
tracker: string;
|
|
210
|
+
/** Label for the connector type. */
|
|
211
|
+
connector: string;
|
|
212
|
+
/** Label for the confirmations count. */
|
|
213
|
+
confirmations: string;
|
|
214
|
+
/** Label for the internal transaction key. */
|
|
215
|
+
txKey: string;
|
|
216
|
+
/** Label for the origin address. */
|
|
217
|
+
from: string;
|
|
218
|
+
/** Label for the recipient address. */
|
|
219
|
+
to: string;
|
|
220
|
+
/** Label for the transaction hash. */
|
|
221
|
+
hash: string;
|
|
222
|
+
/** Label for the network name. */
|
|
223
|
+
network: string;
|
|
224
|
+
/** Label for the raw input data. */
|
|
225
|
+
inputData: string;
|
|
226
|
+
/** Label for the payload data section. */
|
|
227
|
+
payload: string;
|
|
228
|
+
/** Label for the context block. */
|
|
229
|
+
context: string;
|
|
230
|
+
/** Label for the nonce. */
|
|
231
|
+
nonce: string;
|
|
232
|
+
/** Label for the raw value. */
|
|
233
|
+
value: string;
|
|
234
|
+
/** Label for the max fee per gas. */
|
|
235
|
+
maxFee: string;
|
|
236
|
+
/** Label for the max priority fee per gas. */
|
|
237
|
+
maxPriorityFee: string;
|
|
238
|
+
/** Label for the Solana section title. */
|
|
239
|
+
solanaTitle: string;
|
|
240
|
+
/** Label for the Starknet section title. */
|
|
241
|
+
starknetTitle: string;
|
|
242
|
+
/** Label for the Context section title. */
|
|
243
|
+
contextTitle: string;
|
|
244
|
+
/** Label for the Fee. */
|
|
245
|
+
fee: string;
|
|
246
|
+
/** Label for the Slot. */
|
|
247
|
+
slot: string;
|
|
248
|
+
/** Label for the Instructions. */
|
|
249
|
+
instructions: string;
|
|
250
|
+
/** Label for the Recent Blockhash. */
|
|
251
|
+
recentBlockhash: string;
|
|
252
|
+
/** Label for the Contract Address. */
|
|
253
|
+
contractAddress: string;
|
|
254
|
+
/** Label for the Actual Fee. */
|
|
255
|
+
actualFee: string;
|
|
256
|
+
/** Label for the Title Context. */
|
|
257
|
+
titleContext: string;
|
|
258
|
+
/** Label for the Description Context. */
|
|
259
|
+
descriptionContext: string;
|
|
260
|
+
/** Label for the Error Context. */
|
|
261
|
+
errorContext: string;
|
|
262
|
+
/** Label for the Full Payload. */
|
|
263
|
+
fullPayload: string;
|
|
264
|
+
/** Label for the RPC URL. */
|
|
265
|
+
rpcUrl: string;
|
|
266
|
+
/** Label for the Replaced Hash. */
|
|
267
|
+
replacedHash: string;
|
|
268
|
+
};
|
|
192
269
|
};
|
|
193
270
|
|
|
194
271
|
/**
|
|
@@ -211,12 +288,14 @@ type NovaTransactionsProviderProps<T extends Transaction> = {
|
|
|
211
288
|
transactionsInfoModal?: TransactionsInfoModalCustomization<T>;
|
|
212
289
|
trackingTxModal?: TrackingTxModalCustomization<T>;
|
|
213
290
|
};
|
|
291
|
+
/** Pagination state for infinite scroll, forwarded to TransactionsInfoModal and TransactionsHistory. */
|
|
292
|
+
pagination?: TxInMemoryPagination;
|
|
214
293
|
} & Pick<ITxTrackingStore<T>, 'closeTxTrackedModal' | 'executeTxAction' | 'initialTx'> & Omit<ToastContainerProps, 'containerId'>;
|
|
215
294
|
/**
|
|
216
295
|
* The main component for the Nova UI ecosystem. It renders and orchestrates all
|
|
217
296
|
* UI elements like toasts and modals, and provides the i18n context.
|
|
218
297
|
*/
|
|
219
|
-
declare function NovaTransactionsProvider<T extends Transaction>({ adapter, connectedWalletAddress, connectedAdapterType, transactionsPool, initialTx, executeTxAction, closeTxTrackedModal, labels, features, customization, ...toastProps }: NovaTransactionsProviderProps<T>): react_jsx_runtime.JSX.Element;
|
|
298
|
+
declare function NovaTransactionsProvider<T extends Transaction>({ adapter, connectedWalletAddress, connectedAdapterType, transactionsPool, initialTx, executeTxAction, closeTxTrackedModal, labels, features, customization, pagination, ...toastProps }: NovaTransactionsProviderProps<T>): react_jsx_runtime.JSX.Element;
|
|
220
299
|
|
|
221
300
|
type TransactionKeyProps<T extends Transaction> = Pick<NovaTransactionsProviderProps<T>, 'adapter'> & {
|
|
222
301
|
tx: T;
|
|
@@ -264,6 +343,10 @@ type ToastTransactionCustomization<T extends Transaction> = {
|
|
|
264
343
|
TxInfoButton?: ComponentType<CustomActionButtonProps>;
|
|
265
344
|
SpeedUpButton?: ComponentType<CustomActionButtonProps>;
|
|
266
345
|
CancelButton?: ComponentType<CustomActionButtonProps>;
|
|
346
|
+
ConfirmationsBadge?: ComponentType<{
|
|
347
|
+
count: number | string;
|
|
348
|
+
className?: string;
|
|
349
|
+
}>;
|
|
267
350
|
};
|
|
268
351
|
/** Granular classNames for all sub-elements */
|
|
269
352
|
classNames?: {
|
|
@@ -309,11 +392,13 @@ type ToastTransactionCustomization<T extends Transaction> = {
|
|
|
309
392
|
cancelButton?: string;
|
|
310
393
|
/** Classes for the TxInfo button */
|
|
311
394
|
txInfoButton?: string;
|
|
395
|
+
/** Classes for the confirmations badge */
|
|
396
|
+
confirmationsBadge?: string;
|
|
312
397
|
};
|
|
313
398
|
};
|
|
314
399
|
type ToastTransactionProps<T extends Transaction> = {
|
|
315
400
|
tx: T;
|
|
316
|
-
openTxInfoModal?: () => void;
|
|
401
|
+
openTxInfoModal?: (txKey?: string) => void;
|
|
317
402
|
icon?: ReactNode;
|
|
318
403
|
className?: string;
|
|
319
404
|
customization?: ToastTransactionCustomization<T>;
|
|
@@ -554,6 +639,99 @@ type TxStatusVisualProps = {
|
|
|
554
639
|
*/
|
|
555
640
|
declare function TxStatusVisual({ isProcessing, isSucceed, isFailed, isReplaced, className: containerClassName, iconClassNames, }: TxStatusVisualProps): react_jsx_runtime.JSX.Element;
|
|
556
641
|
|
|
642
|
+
/** Props for a copyable field block */
|
|
643
|
+
type CopyableFieldProps = {
|
|
644
|
+
label: string;
|
|
645
|
+
value: string;
|
|
646
|
+
mono?: boolean;
|
|
647
|
+
className?: string;
|
|
648
|
+
children?: ReactNode;
|
|
649
|
+
classNames?: {
|
|
650
|
+
label?: string;
|
|
651
|
+
container?: string;
|
|
652
|
+
code?: string;
|
|
653
|
+
copyButton?: string;
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
/** Props for a single detail item (Label + Value) */
|
|
657
|
+
type DetailItemProps = {
|
|
658
|
+
label: string;
|
|
659
|
+
value: string | number | null | undefined;
|
|
660
|
+
mono?: boolean;
|
|
661
|
+
className?: string;
|
|
662
|
+
classNames?: {
|
|
663
|
+
label?: string;
|
|
664
|
+
value?: string;
|
|
665
|
+
};
|
|
666
|
+
};
|
|
667
|
+
/** Props for a row in the metadata section */
|
|
668
|
+
type MetadataRowProps = {
|
|
669
|
+
icon: ComponentType<{
|
|
670
|
+
className?: string;
|
|
671
|
+
}>;
|
|
672
|
+
label: string;
|
|
673
|
+
children: ReactNode;
|
|
674
|
+
className?: string;
|
|
675
|
+
classNames?: {
|
|
676
|
+
icon?: string;
|
|
677
|
+
label?: string;
|
|
678
|
+
value?: string;
|
|
679
|
+
};
|
|
680
|
+
};
|
|
681
|
+
/** Props for a JSON/Code block */
|
|
682
|
+
type JsonBlockProps = {
|
|
683
|
+
label: string;
|
|
684
|
+
data: unknown;
|
|
685
|
+
className?: string;
|
|
686
|
+
classNames?: {
|
|
687
|
+
header?: string;
|
|
688
|
+
label?: string;
|
|
689
|
+
copyButton?: string;
|
|
690
|
+
container?: string;
|
|
691
|
+
pre?: string;
|
|
692
|
+
};
|
|
693
|
+
};
|
|
694
|
+
type TransactionDetailsCustomization = {
|
|
695
|
+
/** Custom class names for all sub-elements */
|
|
696
|
+
classNames?: {
|
|
697
|
+
container?: string;
|
|
698
|
+
header?: string;
|
|
699
|
+
backButton?: string;
|
|
700
|
+
statusIconContainer?: string;
|
|
701
|
+
title?: string;
|
|
702
|
+
subtitle?: string;
|
|
703
|
+
coreInfoCard?: string;
|
|
704
|
+
networkBadge?: string;
|
|
705
|
+
metadataSection?: string;
|
|
706
|
+
executionSection?: string;
|
|
707
|
+
};
|
|
708
|
+
/** Custom components to override default elements */
|
|
709
|
+
components?: {
|
|
710
|
+
SectionCard?: ComponentType<{
|
|
711
|
+
children: ReactNode;
|
|
712
|
+
className?: string;
|
|
713
|
+
}>;
|
|
714
|
+
SectionHeading?: ComponentType<{
|
|
715
|
+
children: ReactNode;
|
|
716
|
+
className?: string;
|
|
717
|
+
}>;
|
|
718
|
+
CopyableField?: ComponentType<CopyableFieldProps>;
|
|
719
|
+
DetailItem?: ComponentType<DetailItemProps>;
|
|
720
|
+
MetadataRow?: ComponentType<MetadataRowProps>;
|
|
721
|
+
JsonBlock?: ComponentType<JsonBlockProps>;
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
type TransactionDetailsProps<T extends Transaction> = Pick<NovaTransactionsProviderProps<T>, 'adapter'> & {
|
|
725
|
+
tx: T;
|
|
726
|
+
onBack: () => void;
|
|
727
|
+
className?: string;
|
|
728
|
+
customization?: TransactionDetailsCustomization;
|
|
729
|
+
};
|
|
730
|
+
/**
|
|
731
|
+
* TransactionDetails component provides a deep look into a specific transaction's metadata and execution state.
|
|
732
|
+
*/
|
|
733
|
+
declare function TransactionDetails<T extends Transaction>({ tx, onBack, adapter, className, customization, }: TransactionDetailsProps<T>): react_jsx_runtime.JSX.Element;
|
|
734
|
+
|
|
557
735
|
/**
|
|
558
736
|
* @file This file contains the `TransactionHistoryItem` component, which renders a single transaction
|
|
559
737
|
* in a list format for the transaction history view.
|
|
@@ -626,14 +804,23 @@ type TransactionHistoryItemProps<T extends Transaction> = {
|
|
|
626
804
|
customization?: TransactionHistoryItemCustomization<T>;
|
|
627
805
|
/** Optional additional CSS classes for the container. */
|
|
628
806
|
className?: string;
|
|
807
|
+
/** Callback triggered when the item is selected to view details. */
|
|
808
|
+
onSelectTx?: () => void;
|
|
809
|
+
/** Whether transaction details can be viewed by clicking on history items. */
|
|
810
|
+
canViewDetails?: boolean;
|
|
629
811
|
} & Pick<NovaTransactionsProviderProps<T>, 'adapter'>;
|
|
630
|
-
declare function TransactionHistoryItem<T extends Transaction>({ tx, adapter, className, customization, }: TransactionHistoryItemProps<T>): JSX.Element;
|
|
812
|
+
declare function TransactionHistoryItem<T extends Transaction>({ tx, adapter, className, customization, onSelectTx, canViewDetails, }: TransactionHistoryItemProps<T>): JSX.Element;
|
|
631
813
|
|
|
632
814
|
type CustomPlaceholderProps = {
|
|
633
815
|
title: string;
|
|
634
816
|
message: string;
|
|
635
817
|
className?: string;
|
|
636
818
|
};
|
|
819
|
+
/** Props exposed to a custom Loader component */
|
|
820
|
+
type TransactionsHistoryLoaderProps = {
|
|
821
|
+
className?: string;
|
|
822
|
+
iconClassName?: string;
|
|
823
|
+
};
|
|
637
824
|
/**
|
|
638
825
|
* Customization options for TransactionsHistory component.
|
|
639
826
|
* Allows styling of all sub-elements including individual transaction items.
|
|
@@ -655,6 +842,14 @@ type TransactionsHistoryCustomization<T extends Transaction> = {
|
|
|
655
842
|
placeholderTitle?: string;
|
|
656
843
|
/** Classes for the placeholder message */
|
|
657
844
|
placeholderMessage?: string;
|
|
845
|
+
/** Classes for the infinite scroll loader container */
|
|
846
|
+
loaderContainer?: string;
|
|
847
|
+
/** Classes for the infinite scroll loader icon (spinner) */
|
|
848
|
+
loaderIcon?: string;
|
|
849
|
+
/** Classes for the error indicator container */
|
|
850
|
+
errorContainer?: string;
|
|
851
|
+
/** Classes for the error indicator icon */
|
|
852
|
+
errorIcon?: string;
|
|
658
853
|
/** Classes for individual transaction item container */
|
|
659
854
|
itemContainer?: string;
|
|
660
855
|
/** Classes for the icon wrapper */
|
|
@@ -696,13 +891,23 @@ type TransactionsHistoryCustomization<T extends Transaction> = {
|
|
|
696
891
|
Placeholder?: ComponentType<CustomPlaceholderProps>;
|
|
697
892
|
/** Custom history item component */
|
|
698
893
|
HistoryItem?: ComponentType<TransactionHistoryItemProps<T>>;
|
|
894
|
+
/** Custom loader component rendered at the bottom during pagination loading */
|
|
895
|
+
Loader?: ComponentType<TransactionsHistoryLoaderProps>;
|
|
699
896
|
};
|
|
897
|
+
/** Customization for the detailed transaction view */
|
|
898
|
+
detailsCustomization?: TransactionDetailsCustomization;
|
|
700
899
|
};
|
|
701
900
|
type TransactionsHistoryProps<T extends Transaction> = Pick<NovaTransactionsProviderProps<T>, 'adapter' | 'transactionsPool' | 'connectedWalletAddress'> & {
|
|
702
901
|
className?: string;
|
|
703
902
|
customization?: TransactionsHistoryCustomization<T>;
|
|
903
|
+
/** Pagination state for infinite scroll. Uses TxInMemoryPagination from @tuwaio/pulsar-core. */
|
|
904
|
+
pagination?: TxInMemoryPagination;
|
|
905
|
+
/** Optional transaction key to open directly in detail view */
|
|
906
|
+
initialTxKey?: string | null;
|
|
907
|
+
/** Whether transaction details can be viewed by clicking on history items. Defaults to true. */
|
|
908
|
+
canViewDetails?: boolean;
|
|
704
909
|
};
|
|
705
|
-
declare function TransactionsHistory<T extends Transaction>({ adapter, connectedWalletAddress, transactionsPool, className, customization, }: TransactionsHistoryProps<T>): react_jsx_runtime.JSX.Element;
|
|
910
|
+
declare function TransactionsHistory<T extends Transaction>({ adapter, connectedWalletAddress, transactionsPool, className, customization, pagination, initialTxKey, canViewDetails, }: TransactionsHistoryProps<T>): react_jsx_runtime.JSX.Element;
|
|
706
911
|
|
|
707
912
|
type CustomHeaderProps = {
|
|
708
913
|
closeModal: () => void;
|
|
@@ -732,7 +937,11 @@ type TransactionsInfoModalProps<T extends Transaction> = Pick<NovaTransactionsPr
|
|
|
732
937
|
isOpen?: boolean;
|
|
733
938
|
setIsOpen: (value: boolean) => void;
|
|
734
939
|
customization?: TransactionsInfoModalCustomization<T>;
|
|
940
|
+
/** Pagination state for infinite scroll, forwarded to TransactionsHistory. */
|
|
941
|
+
pagination?: TxInMemoryPagination;
|
|
942
|
+
/** Optional transaction key to open directly in detail view */
|
|
943
|
+
selectedTxKey?: string | null;
|
|
735
944
|
};
|
|
736
|
-
declare function TransactionsInfoModal<T extends Transaction>({ isOpen, setIsOpen, customization, adapter, connectedWalletAddress, transactionsPool, }: TransactionsInfoModalProps<T>): react_jsx_runtime.JSX.Element;
|
|
945
|
+
declare function TransactionsInfoModal<T extends Transaction>({ isOpen, setIsOpen, customization, adapter, connectedWalletAddress, transactionsPool, pagination, selectedTxKey, }: TransactionsInfoModalProps<T>): react_jsx_runtime.JSX.Element;
|
|
737
946
|
|
|
738
|
-
export {
|
|
947
|
+
export { TransactionHistoryItem as A, type TransactionKeyProps as B, type CopyableFieldProps as C, type DetailItemProps as D, TransactionKey as E, type TransactionsHistoryLoaderProps as F, type TransactionsHistoryCustomization as G, type HashLinkProps as H, type TransactionsHistoryProps as I, type JsonBlockProps as J, TransactionsHistory as K, type TransactionsInfoModalCustomization as L, type MetadataRowProps as M, type NovaTransactionsLabels as N, type TransactionsInfoModalProps as O, TransactionsInfoModal as P, type TransactionStatusBadgeProps as Q, TransactionStatusBadge as R, type StatusAwareTextProps as S, type ToastTransactionCustomization as T, type NovaTransactionsProviderProps as U, NovaTransactionsProvider as V, HashLink as a, StatusAwareText as b, type ToastTransactionProps as c, ToastTransaction as d, type TrackingTxModalCustomization as e, type TrackingTxModalProps as f, TrackingTxModal as g, type TxErrorBlockClassNames as h, type TxErrorBlockProps as i, TxErrorBlock as j, type TxInfoBlockCustomization as k, type TxInfoBlockProps as l, TxInfoBlock as m, type StepStatus as n, type StepClassNames as o, type StepProps as p, type TxProgressIndicatorProps as q, TxProgressIndicator as r, type TxStatusVisualClassNames as s, type TxStatusVisualProps as t, TxStatusVisual as u, type TransactionDetailsCustomization as v, type TransactionDetailsProps as w, TransactionDetails as x, type TransactionHistoryItemCustomization as y, type TransactionHistoryItemProps as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ToastCloseButtonProps, DialogContent } from '@tuwaio/nova-core';
|
|
3
|
-
import { TransactionStatus, Transaction, TxAdapter, TransactionPool, ITxTrackingStore, InitialTransaction } from '@tuwaio/pulsar-core';
|
|
3
|
+
import { TransactionStatus, Transaction, TxAdapter, TransactionPool, TxInMemoryPagination, ITxTrackingStore, InitialTransaction } from '@tuwaio/pulsar-core';
|
|
4
4
|
import { ReactNode, ComponentType, JSX, ComponentPropsWithoutRef } from 'react';
|
|
5
5
|
import { OrbitAdapter, TuwaErrorState } from '@tuwaio/orbit-core';
|
|
6
6
|
import { ToastContainerProps, ToastContentProps } from 'react-toastify';
|
|
@@ -91,7 +91,7 @@ type NovaTransactionsLabels = {
|
|
|
91
91
|
/** Labels related to toast notifications. */
|
|
92
92
|
toast: {
|
|
93
93
|
/** Text for the button/link within a toast to open the wallet modal. */
|
|
94
|
-
|
|
94
|
+
openTransaction: string;
|
|
95
95
|
};
|
|
96
96
|
/** Standard labels for transaction statuses. */
|
|
97
97
|
statuses: {
|
|
@@ -189,6 +189,83 @@ type NovaTransactionsLabels = {
|
|
|
189
189
|
/** Text for a generic "Speed up" action. */
|
|
190
190
|
speedUp: string;
|
|
191
191
|
};
|
|
192
|
+
/** Labels for the detailed transaction view. */
|
|
193
|
+
transactionDetails: {
|
|
194
|
+
/** Main title for the detailed view. */
|
|
195
|
+
title: string;
|
|
196
|
+
/** Subtitle for the detailed view. */
|
|
197
|
+
subtitle: string;
|
|
198
|
+
/** Label for the metadata section. */
|
|
199
|
+
metadata: string;
|
|
200
|
+
/** Label for the execution data section. */
|
|
201
|
+
executionData: string;
|
|
202
|
+
/** Label for the adapter type. */
|
|
203
|
+
adapter: string;
|
|
204
|
+
/** Label for the submission time. */
|
|
205
|
+
submittedAt: string;
|
|
206
|
+
/** Label for the completion time. */
|
|
207
|
+
finishedAt: string;
|
|
208
|
+
/** Label for the tracker name. */
|
|
209
|
+
tracker: string;
|
|
210
|
+
/** Label for the connector type. */
|
|
211
|
+
connector: string;
|
|
212
|
+
/** Label for the confirmations count. */
|
|
213
|
+
confirmations: string;
|
|
214
|
+
/** Label for the internal transaction key. */
|
|
215
|
+
txKey: string;
|
|
216
|
+
/** Label for the origin address. */
|
|
217
|
+
from: string;
|
|
218
|
+
/** Label for the recipient address. */
|
|
219
|
+
to: string;
|
|
220
|
+
/** Label for the transaction hash. */
|
|
221
|
+
hash: string;
|
|
222
|
+
/** Label for the network name. */
|
|
223
|
+
network: string;
|
|
224
|
+
/** Label for the raw input data. */
|
|
225
|
+
inputData: string;
|
|
226
|
+
/** Label for the payload data section. */
|
|
227
|
+
payload: string;
|
|
228
|
+
/** Label for the context block. */
|
|
229
|
+
context: string;
|
|
230
|
+
/** Label for the nonce. */
|
|
231
|
+
nonce: string;
|
|
232
|
+
/** Label for the raw value. */
|
|
233
|
+
value: string;
|
|
234
|
+
/** Label for the max fee per gas. */
|
|
235
|
+
maxFee: string;
|
|
236
|
+
/** Label for the max priority fee per gas. */
|
|
237
|
+
maxPriorityFee: string;
|
|
238
|
+
/** Label for the Solana section title. */
|
|
239
|
+
solanaTitle: string;
|
|
240
|
+
/** Label for the Starknet section title. */
|
|
241
|
+
starknetTitle: string;
|
|
242
|
+
/** Label for the Context section title. */
|
|
243
|
+
contextTitle: string;
|
|
244
|
+
/** Label for the Fee. */
|
|
245
|
+
fee: string;
|
|
246
|
+
/** Label for the Slot. */
|
|
247
|
+
slot: string;
|
|
248
|
+
/** Label for the Instructions. */
|
|
249
|
+
instructions: string;
|
|
250
|
+
/** Label for the Recent Blockhash. */
|
|
251
|
+
recentBlockhash: string;
|
|
252
|
+
/** Label for the Contract Address. */
|
|
253
|
+
contractAddress: string;
|
|
254
|
+
/** Label for the Actual Fee. */
|
|
255
|
+
actualFee: string;
|
|
256
|
+
/** Label for the Title Context. */
|
|
257
|
+
titleContext: string;
|
|
258
|
+
/** Label for the Description Context. */
|
|
259
|
+
descriptionContext: string;
|
|
260
|
+
/** Label for the Error Context. */
|
|
261
|
+
errorContext: string;
|
|
262
|
+
/** Label for the Full Payload. */
|
|
263
|
+
fullPayload: string;
|
|
264
|
+
/** Label for the RPC URL. */
|
|
265
|
+
rpcUrl: string;
|
|
266
|
+
/** Label for the Replaced Hash. */
|
|
267
|
+
replacedHash: string;
|
|
268
|
+
};
|
|
192
269
|
};
|
|
193
270
|
|
|
194
271
|
/**
|
|
@@ -211,12 +288,14 @@ type NovaTransactionsProviderProps<T extends Transaction> = {
|
|
|
211
288
|
transactionsInfoModal?: TransactionsInfoModalCustomization<T>;
|
|
212
289
|
trackingTxModal?: TrackingTxModalCustomization<T>;
|
|
213
290
|
};
|
|
291
|
+
/** Pagination state for infinite scroll, forwarded to TransactionsInfoModal and TransactionsHistory. */
|
|
292
|
+
pagination?: TxInMemoryPagination;
|
|
214
293
|
} & Pick<ITxTrackingStore<T>, 'closeTxTrackedModal' | 'executeTxAction' | 'initialTx'> & Omit<ToastContainerProps, 'containerId'>;
|
|
215
294
|
/**
|
|
216
295
|
* The main component for the Nova UI ecosystem. It renders and orchestrates all
|
|
217
296
|
* UI elements like toasts and modals, and provides the i18n context.
|
|
218
297
|
*/
|
|
219
|
-
declare function NovaTransactionsProvider<T extends Transaction>({ adapter, connectedWalletAddress, connectedAdapterType, transactionsPool, initialTx, executeTxAction, closeTxTrackedModal, labels, features, customization, ...toastProps }: NovaTransactionsProviderProps<T>): react_jsx_runtime.JSX.Element;
|
|
298
|
+
declare function NovaTransactionsProvider<T extends Transaction>({ adapter, connectedWalletAddress, connectedAdapterType, transactionsPool, initialTx, executeTxAction, closeTxTrackedModal, labels, features, customization, pagination, ...toastProps }: NovaTransactionsProviderProps<T>): react_jsx_runtime.JSX.Element;
|
|
220
299
|
|
|
221
300
|
type TransactionKeyProps<T extends Transaction> = Pick<NovaTransactionsProviderProps<T>, 'adapter'> & {
|
|
222
301
|
tx: T;
|
|
@@ -264,6 +343,10 @@ type ToastTransactionCustomization<T extends Transaction> = {
|
|
|
264
343
|
TxInfoButton?: ComponentType<CustomActionButtonProps>;
|
|
265
344
|
SpeedUpButton?: ComponentType<CustomActionButtonProps>;
|
|
266
345
|
CancelButton?: ComponentType<CustomActionButtonProps>;
|
|
346
|
+
ConfirmationsBadge?: ComponentType<{
|
|
347
|
+
count: number | string;
|
|
348
|
+
className?: string;
|
|
349
|
+
}>;
|
|
267
350
|
};
|
|
268
351
|
/** Granular classNames for all sub-elements */
|
|
269
352
|
classNames?: {
|
|
@@ -309,11 +392,13 @@ type ToastTransactionCustomization<T extends Transaction> = {
|
|
|
309
392
|
cancelButton?: string;
|
|
310
393
|
/** Classes for the TxInfo button */
|
|
311
394
|
txInfoButton?: string;
|
|
395
|
+
/** Classes for the confirmations badge */
|
|
396
|
+
confirmationsBadge?: string;
|
|
312
397
|
};
|
|
313
398
|
};
|
|
314
399
|
type ToastTransactionProps<T extends Transaction> = {
|
|
315
400
|
tx: T;
|
|
316
|
-
openTxInfoModal?: () => void;
|
|
401
|
+
openTxInfoModal?: (txKey?: string) => void;
|
|
317
402
|
icon?: ReactNode;
|
|
318
403
|
className?: string;
|
|
319
404
|
customization?: ToastTransactionCustomization<T>;
|
|
@@ -554,6 +639,99 @@ type TxStatusVisualProps = {
|
|
|
554
639
|
*/
|
|
555
640
|
declare function TxStatusVisual({ isProcessing, isSucceed, isFailed, isReplaced, className: containerClassName, iconClassNames, }: TxStatusVisualProps): react_jsx_runtime.JSX.Element;
|
|
556
641
|
|
|
642
|
+
/** Props for a copyable field block */
|
|
643
|
+
type CopyableFieldProps = {
|
|
644
|
+
label: string;
|
|
645
|
+
value: string;
|
|
646
|
+
mono?: boolean;
|
|
647
|
+
className?: string;
|
|
648
|
+
children?: ReactNode;
|
|
649
|
+
classNames?: {
|
|
650
|
+
label?: string;
|
|
651
|
+
container?: string;
|
|
652
|
+
code?: string;
|
|
653
|
+
copyButton?: string;
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
/** Props for a single detail item (Label + Value) */
|
|
657
|
+
type DetailItemProps = {
|
|
658
|
+
label: string;
|
|
659
|
+
value: string | number | null | undefined;
|
|
660
|
+
mono?: boolean;
|
|
661
|
+
className?: string;
|
|
662
|
+
classNames?: {
|
|
663
|
+
label?: string;
|
|
664
|
+
value?: string;
|
|
665
|
+
};
|
|
666
|
+
};
|
|
667
|
+
/** Props for a row in the metadata section */
|
|
668
|
+
type MetadataRowProps = {
|
|
669
|
+
icon: ComponentType<{
|
|
670
|
+
className?: string;
|
|
671
|
+
}>;
|
|
672
|
+
label: string;
|
|
673
|
+
children: ReactNode;
|
|
674
|
+
className?: string;
|
|
675
|
+
classNames?: {
|
|
676
|
+
icon?: string;
|
|
677
|
+
label?: string;
|
|
678
|
+
value?: string;
|
|
679
|
+
};
|
|
680
|
+
};
|
|
681
|
+
/** Props for a JSON/Code block */
|
|
682
|
+
type JsonBlockProps = {
|
|
683
|
+
label: string;
|
|
684
|
+
data: unknown;
|
|
685
|
+
className?: string;
|
|
686
|
+
classNames?: {
|
|
687
|
+
header?: string;
|
|
688
|
+
label?: string;
|
|
689
|
+
copyButton?: string;
|
|
690
|
+
container?: string;
|
|
691
|
+
pre?: string;
|
|
692
|
+
};
|
|
693
|
+
};
|
|
694
|
+
type TransactionDetailsCustomization = {
|
|
695
|
+
/** Custom class names for all sub-elements */
|
|
696
|
+
classNames?: {
|
|
697
|
+
container?: string;
|
|
698
|
+
header?: string;
|
|
699
|
+
backButton?: string;
|
|
700
|
+
statusIconContainer?: string;
|
|
701
|
+
title?: string;
|
|
702
|
+
subtitle?: string;
|
|
703
|
+
coreInfoCard?: string;
|
|
704
|
+
networkBadge?: string;
|
|
705
|
+
metadataSection?: string;
|
|
706
|
+
executionSection?: string;
|
|
707
|
+
};
|
|
708
|
+
/** Custom components to override default elements */
|
|
709
|
+
components?: {
|
|
710
|
+
SectionCard?: ComponentType<{
|
|
711
|
+
children: ReactNode;
|
|
712
|
+
className?: string;
|
|
713
|
+
}>;
|
|
714
|
+
SectionHeading?: ComponentType<{
|
|
715
|
+
children: ReactNode;
|
|
716
|
+
className?: string;
|
|
717
|
+
}>;
|
|
718
|
+
CopyableField?: ComponentType<CopyableFieldProps>;
|
|
719
|
+
DetailItem?: ComponentType<DetailItemProps>;
|
|
720
|
+
MetadataRow?: ComponentType<MetadataRowProps>;
|
|
721
|
+
JsonBlock?: ComponentType<JsonBlockProps>;
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
type TransactionDetailsProps<T extends Transaction> = Pick<NovaTransactionsProviderProps<T>, 'adapter'> & {
|
|
725
|
+
tx: T;
|
|
726
|
+
onBack: () => void;
|
|
727
|
+
className?: string;
|
|
728
|
+
customization?: TransactionDetailsCustomization;
|
|
729
|
+
};
|
|
730
|
+
/**
|
|
731
|
+
* TransactionDetails component provides a deep look into a specific transaction's metadata and execution state.
|
|
732
|
+
*/
|
|
733
|
+
declare function TransactionDetails<T extends Transaction>({ tx, onBack, adapter, className, customization, }: TransactionDetailsProps<T>): react_jsx_runtime.JSX.Element;
|
|
734
|
+
|
|
557
735
|
/**
|
|
558
736
|
* @file This file contains the `TransactionHistoryItem` component, which renders a single transaction
|
|
559
737
|
* in a list format for the transaction history view.
|
|
@@ -626,14 +804,23 @@ type TransactionHistoryItemProps<T extends Transaction> = {
|
|
|
626
804
|
customization?: TransactionHistoryItemCustomization<T>;
|
|
627
805
|
/** Optional additional CSS classes for the container. */
|
|
628
806
|
className?: string;
|
|
807
|
+
/** Callback triggered when the item is selected to view details. */
|
|
808
|
+
onSelectTx?: () => void;
|
|
809
|
+
/** Whether transaction details can be viewed by clicking on history items. */
|
|
810
|
+
canViewDetails?: boolean;
|
|
629
811
|
} & Pick<NovaTransactionsProviderProps<T>, 'adapter'>;
|
|
630
|
-
declare function TransactionHistoryItem<T extends Transaction>({ tx, adapter, className, customization, }: TransactionHistoryItemProps<T>): JSX.Element;
|
|
812
|
+
declare function TransactionHistoryItem<T extends Transaction>({ tx, adapter, className, customization, onSelectTx, canViewDetails, }: TransactionHistoryItemProps<T>): JSX.Element;
|
|
631
813
|
|
|
632
814
|
type CustomPlaceholderProps = {
|
|
633
815
|
title: string;
|
|
634
816
|
message: string;
|
|
635
817
|
className?: string;
|
|
636
818
|
};
|
|
819
|
+
/** Props exposed to a custom Loader component */
|
|
820
|
+
type TransactionsHistoryLoaderProps = {
|
|
821
|
+
className?: string;
|
|
822
|
+
iconClassName?: string;
|
|
823
|
+
};
|
|
637
824
|
/**
|
|
638
825
|
* Customization options for TransactionsHistory component.
|
|
639
826
|
* Allows styling of all sub-elements including individual transaction items.
|
|
@@ -655,6 +842,14 @@ type TransactionsHistoryCustomization<T extends Transaction> = {
|
|
|
655
842
|
placeholderTitle?: string;
|
|
656
843
|
/** Classes for the placeholder message */
|
|
657
844
|
placeholderMessage?: string;
|
|
845
|
+
/** Classes for the infinite scroll loader container */
|
|
846
|
+
loaderContainer?: string;
|
|
847
|
+
/** Classes for the infinite scroll loader icon (spinner) */
|
|
848
|
+
loaderIcon?: string;
|
|
849
|
+
/** Classes for the error indicator container */
|
|
850
|
+
errorContainer?: string;
|
|
851
|
+
/** Classes for the error indicator icon */
|
|
852
|
+
errorIcon?: string;
|
|
658
853
|
/** Classes for individual transaction item container */
|
|
659
854
|
itemContainer?: string;
|
|
660
855
|
/** Classes for the icon wrapper */
|
|
@@ -696,13 +891,23 @@ type TransactionsHistoryCustomization<T extends Transaction> = {
|
|
|
696
891
|
Placeholder?: ComponentType<CustomPlaceholderProps>;
|
|
697
892
|
/** Custom history item component */
|
|
698
893
|
HistoryItem?: ComponentType<TransactionHistoryItemProps<T>>;
|
|
894
|
+
/** Custom loader component rendered at the bottom during pagination loading */
|
|
895
|
+
Loader?: ComponentType<TransactionsHistoryLoaderProps>;
|
|
699
896
|
};
|
|
897
|
+
/** Customization for the detailed transaction view */
|
|
898
|
+
detailsCustomization?: TransactionDetailsCustomization;
|
|
700
899
|
};
|
|
701
900
|
type TransactionsHistoryProps<T extends Transaction> = Pick<NovaTransactionsProviderProps<T>, 'adapter' | 'transactionsPool' | 'connectedWalletAddress'> & {
|
|
702
901
|
className?: string;
|
|
703
902
|
customization?: TransactionsHistoryCustomization<T>;
|
|
903
|
+
/** Pagination state for infinite scroll. Uses TxInMemoryPagination from @tuwaio/pulsar-core. */
|
|
904
|
+
pagination?: TxInMemoryPagination;
|
|
905
|
+
/** Optional transaction key to open directly in detail view */
|
|
906
|
+
initialTxKey?: string | null;
|
|
907
|
+
/** Whether transaction details can be viewed by clicking on history items. Defaults to true. */
|
|
908
|
+
canViewDetails?: boolean;
|
|
704
909
|
};
|
|
705
|
-
declare function TransactionsHistory<T extends Transaction>({ adapter, connectedWalletAddress, transactionsPool, className, customization, }: TransactionsHistoryProps<T>): react_jsx_runtime.JSX.Element;
|
|
910
|
+
declare function TransactionsHistory<T extends Transaction>({ adapter, connectedWalletAddress, transactionsPool, className, customization, pagination, initialTxKey, canViewDetails, }: TransactionsHistoryProps<T>): react_jsx_runtime.JSX.Element;
|
|
706
911
|
|
|
707
912
|
type CustomHeaderProps = {
|
|
708
913
|
closeModal: () => void;
|
|
@@ -732,7 +937,11 @@ type TransactionsInfoModalProps<T extends Transaction> = Pick<NovaTransactionsPr
|
|
|
732
937
|
isOpen?: boolean;
|
|
733
938
|
setIsOpen: (value: boolean) => void;
|
|
734
939
|
customization?: TransactionsInfoModalCustomization<T>;
|
|
940
|
+
/** Pagination state for infinite scroll, forwarded to TransactionsHistory. */
|
|
941
|
+
pagination?: TxInMemoryPagination;
|
|
942
|
+
/** Optional transaction key to open directly in detail view */
|
|
943
|
+
selectedTxKey?: string | null;
|
|
735
944
|
};
|
|
736
|
-
declare function TransactionsInfoModal<T extends Transaction>({ isOpen, setIsOpen, customization, adapter, connectedWalletAddress, transactionsPool, }: TransactionsInfoModalProps<T>): react_jsx_runtime.JSX.Element;
|
|
945
|
+
declare function TransactionsInfoModal<T extends Transaction>({ isOpen, setIsOpen, customization, adapter, connectedWalletAddress, transactionsPool, pagination, selectedTxKey, }: TransactionsInfoModalProps<T>): react_jsx_runtime.JSX.Element;
|
|
737
946
|
|
|
738
|
-
export {
|
|
947
|
+
export { TransactionHistoryItem as A, type TransactionKeyProps as B, type CopyableFieldProps as C, type DetailItemProps as D, TransactionKey as E, type TransactionsHistoryLoaderProps as F, type TransactionsHistoryCustomization as G, type HashLinkProps as H, type TransactionsHistoryProps as I, type JsonBlockProps as J, TransactionsHistory as K, type TransactionsInfoModalCustomization as L, type MetadataRowProps as M, type NovaTransactionsLabels as N, type TransactionsInfoModalProps as O, TransactionsInfoModal as P, type TransactionStatusBadgeProps as Q, TransactionStatusBadge as R, type StatusAwareTextProps as S, type ToastTransactionCustomization as T, type NovaTransactionsProviderProps as U, NovaTransactionsProvider as V, HashLink as a, StatusAwareText as b, type ToastTransactionProps as c, ToastTransaction as d, type TrackingTxModalCustomization as e, type TrackingTxModalProps as f, TrackingTxModal as g, type TxErrorBlockClassNames as h, type TxErrorBlockProps as i, TxErrorBlock as j, type TxInfoBlockCustomization as k, type TxInfoBlockProps as l, TxInfoBlock as m, type StepStatus as n, type StepClassNames as o, type StepProps as p, type TxProgressIndicatorProps as q, TxProgressIndicator as r, type TxStatusVisualClassNames as s, type TxStatusVisualProps as t, TxStatusVisual as u, type TransactionDetailsCustomization as v, type TransactionDetailsProps as w, TransactionDetails as x, type TransactionHistoryItemCustomization as y, type TransactionHistoryItemProps as z };
|