@gearbox-protocol/ui-kit 3.14.0-next.11 → 3.14.0-next.13
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 +1 -0
- package/dist/cjs/components/composites/tx-preview/components/AddressAvatar.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/components/AddressParty.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/components/AddressRow.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/components/AmountRow.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/components/CollapsibleCard.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/components/SectionDivider.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/components/TransferList.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/components/TransferRow.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/components/addressLabel.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/components/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/constants.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/useTransactionConfirmDialog.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/hooks/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/hooks/useCalldataOperationPreview.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/preview/OperationPreviewContent.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/preview/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/stepper/HorizontalTransactionStepper.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/stepper/computeTransactionExecutionSteps.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/stepper/constants.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/stepper/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/hooks/useParsedTransaction.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/operations/OperationBody.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/operations/OperationsCard.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/operations/PoolDepositView.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/operations/PoolRow.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/operations/PoolWithdrawView.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/operations/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/prerequisites/PrerequisiteRow.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/prerequisites/PrerequisitesCard.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/prerequisites/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/prerequisites/prerequisiteDetails.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/prerequisites/usePrerequisites.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/state-change/BalanceChangeGroup.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/state-change/BalanceChangeRow.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/state-change/PoolStateChangeCard.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/state-change/StateChangeCard.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/state-change/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/types.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/utils/addressLabels.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/utils/index.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/utils/poolTokenInfo.cjs +1 -0
- package/dist/cjs/components/layout/main-aside-layout/main-aside-layout.cjs +1 -1
- package/dist/esm/components/composites/tx-preview/components/AddressAvatar.js +47 -0
- package/dist/esm/components/composites/tx-preview/components/AddressParty.js +17 -0
- package/dist/esm/components/composites/tx-preview/components/AddressRow.js +16 -0
- package/dist/esm/components/composites/tx-preview/components/AmountRow.js +30 -0
- package/dist/esm/components/composites/tx-preview/components/CollapsibleCard.js +45 -0
- package/dist/esm/components/composites/tx-preview/components/SectionDivider.js +12 -0
- package/dist/esm/components/composites/tx-preview/components/TransferList.js +25 -0
- package/dist/esm/components/composites/tx-preview/components/TransferRow.js +52 -0
- package/dist/esm/components/composites/tx-preview/components/addressLabel.js +7 -0
- package/dist/esm/components/composites/tx-preview/components/index.js +20 -0
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.js +58 -0
- package/dist/esm/components/composites/tx-preview/confirm/dialog/constants.js +7 -0
- package/dist/esm/components/composites/tx-preview/confirm/dialog/index.js +8 -0
- package/dist/esm/components/composites/tx-preview/confirm/dialog/useTransactionConfirmDialog.js +20 -0
- package/dist/esm/components/composites/tx-preview/confirm/hooks/index.js +4 -0
- package/dist/esm/components/composites/tx-preview/confirm/hooks/useCalldataOperationPreview.js +35 -0
- package/dist/esm/components/composites/tx-preview/confirm/index.js +18 -0
- package/dist/esm/components/composites/tx-preview/confirm/preview/OperationPreviewContent.js +203 -0
- package/dist/esm/components/composites/tx-preview/confirm/preview/index.js +4 -0
- package/dist/esm/components/composites/tx-preview/confirm/stepper/HorizontalTransactionStepper.js +120 -0
- package/dist/esm/components/composites/tx-preview/confirm/stepper/computeTransactionExecutionSteps.js +28 -0
- package/dist/esm/components/composites/tx-preview/confirm/stepper/constants.js +6 -0
- package/dist/esm/components/composites/tx-preview/confirm/stepper/index.js +8 -0
- package/dist/esm/components/composites/tx-preview/hooks/useParsedTransaction.js +45 -0
- package/dist/esm/components/composites/tx-preview/index.js +70 -0
- package/dist/esm/components/composites/tx-preview/operations/OperationBody.js +10 -0
- package/dist/esm/components/composites/tx-preview/operations/OperationsCard.js +191 -0
- package/dist/esm/components/composites/tx-preview/operations/PoolDepositView.js +200 -0
- package/dist/esm/components/composites/tx-preview/operations/PoolRow.js +20 -0
- package/dist/esm/components/composites/tx-preview/operations/PoolWithdrawView.js +194 -0
- package/dist/esm/components/composites/tx-preview/operations/index.js +13 -0
- package/dist/esm/components/composites/tx-preview/prerequisites/PrerequisiteRow.js +21 -0
- package/dist/esm/components/composites/tx-preview/prerequisites/PrerequisitesCard.js +206 -0
- package/dist/esm/components/composites/tx-preview/prerequisites/index.js +11 -0
- package/dist/esm/components/composites/tx-preview/prerequisites/prerequisiteDetails.js +58 -0
- package/dist/esm/components/composites/tx-preview/prerequisites/usePrerequisites.js +39 -0
- package/dist/esm/components/composites/tx-preview/state-change/BalanceChangeGroup.js +181 -0
- package/dist/esm/components/composites/tx-preview/state-change/BalanceChangeRow.js +61 -0
- package/dist/esm/components/composites/tx-preview/state-change/PoolStateChangeCard.js +23 -0
- package/dist/esm/components/composites/tx-preview/state-change/StateChangeCard.js +196 -0
- package/dist/esm/components/composites/tx-preview/state-change/index.js +10 -0
- package/dist/esm/components/composites/tx-preview/types.js +1 -0
- package/dist/esm/components/composites/tx-preview/utils/addressLabels.js +41 -0
- package/dist/esm/components/composites/tx-preview/utils/index.js +6 -0
- package/dist/esm/components/composites/tx-preview/utils/poolTokenInfo.js +12 -0
- package/dist/esm/components/layout/main-aside-layout/main-aside-layout.js +30 -30
- package/dist/globals.css +1 -1
- package/dist/types/components/composites/tx-preview/components/AddressAvatar.d.ts +12 -0
- package/dist/types/components/composites/tx-preview/components/AddressParty.d.ts +14 -0
- package/dist/types/components/composites/tx-preview/components/AddressRow.d.ts +7 -0
- package/dist/types/components/composites/tx-preview/components/AmountRow.d.ts +15 -0
- package/dist/types/components/composites/tx-preview/components/CollapsibleCard.d.ts +22 -0
- package/dist/types/components/composites/tx-preview/components/SectionDivider.d.ts +10 -0
- package/dist/types/components/composites/tx-preview/components/TransferList.d.ts +19 -0
- package/dist/types/components/composites/tx-preview/components/TransferRow.d.ts +30 -0
- package/dist/types/components/composites/tx-preview/components/addressLabel.d.ts +27 -0
- package/dist/types/components/composites/tx-preview/components/index.d.ts +9 -0
- package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.d.ts +15 -0
- package/dist/types/components/composites/tx-preview/confirm/dialog/constants.d.ts +4 -0
- package/dist/types/components/composites/tx-preview/confirm/dialog/index.d.ts +3 -0
- package/dist/types/components/composites/tx-preview/confirm/dialog/useTransactionConfirmDialog.d.ts +8 -0
- package/dist/types/components/composites/tx-preview/confirm/hooks/index.d.ts +1 -0
- package/dist/types/components/composites/tx-preview/confirm/hooks/useCalldataOperationPreview.d.ts +19 -0
- package/dist/types/components/composites/tx-preview/confirm/index.d.ts +4 -0
- package/dist/types/components/composites/tx-preview/confirm/preview/OperationPreviewContent.d.ts +13 -0
- package/dist/types/components/composites/tx-preview/confirm/preview/index.d.ts +1 -0
- package/dist/types/components/composites/tx-preview/confirm/stepper/HorizontalTransactionStepper.d.ts +7 -0
- package/dist/types/components/composites/tx-preview/confirm/stepper/computeTransactionExecutionSteps.d.ts +21 -0
- package/dist/types/components/composites/tx-preview/confirm/stepper/constants.d.ts +3 -0
- package/dist/types/components/composites/tx-preview/confirm/stepper/index.d.ts +3 -0
- package/dist/types/components/composites/tx-preview/hooks/useParsedTransaction.d.ts +40 -0
- package/dist/types/components/composites/tx-preview/index.d.ts +19 -0
- package/dist/types/components/composites/tx-preview/operations/OperationBody.d.ts +15 -0
- package/dist/types/components/composites/tx-preview/operations/OperationsCard.d.ts +21 -0
- package/dist/types/components/composites/tx-preview/operations/PoolDepositView.d.ts +11 -0
- package/dist/types/components/composites/tx-preview/operations/PoolRow.d.ts +8 -0
- package/dist/types/components/composites/tx-preview/operations/PoolWithdrawView.d.ts +11 -0
- package/dist/types/components/composites/tx-preview/operations/index.d.ts +5 -0
- package/dist/types/components/composites/tx-preview/prerequisites/PrerequisiteRow.d.ts +11 -0
- package/dist/types/components/composites/tx-preview/prerequisites/PrerequisitesCard.d.ts +17 -0
- package/dist/types/components/composites/tx-preview/prerequisites/index.d.ts +4 -0
- package/dist/types/components/composites/tx-preview/prerequisites/prerequisiteDetails.d.ts +17 -0
- package/dist/types/components/composites/tx-preview/prerequisites/usePrerequisites.d.ts +25 -0
- package/dist/types/components/composites/tx-preview/state-change/BalanceChangeGroup.d.ts +11 -0
- package/dist/types/components/composites/tx-preview/state-change/BalanceChangeRow.d.ts +14 -0
- package/dist/types/components/composites/tx-preview/state-change/PoolStateChangeCard.d.ts +18 -0
- package/dist/types/components/composites/tx-preview/state-change/StateChangeCard.d.ts +21 -0
- package/dist/types/components/composites/tx-preview/state-change/index.d.ts +4 -0
- package/dist/types/components/composites/tx-preview/types.d.ts +19 -0
- package/dist/types/components/composites/tx-preview/utils/addressLabels.d.ts +16 -0
- package/dist/types/components/composites/tx-preview/utils/index.d.ts +2 -0
- package/dist/types/components/composites/tx-preview/utils/poolTokenInfo.d.ts +14 -0
- package/dist/types/components/layout/main-aside-layout/main-aside-layout.d.ts +5 -15
- package/package.json +12 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { AddressRole } from './addressLabel';
|
|
3
|
+
export interface AddressAvatarProps {
|
|
4
|
+
address: Address;
|
|
5
|
+
role?: AddressRole;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Small round avatar for an operation party. Picks an icon based on `role`:
|
|
9
|
+
* wallet / credit-account get a Font Awesome glyph, pools get the Gearbox brand
|
|
10
|
+
* logo, and everything else falls back to an address-derived {@link Identicon}.
|
|
11
|
+
*/
|
|
12
|
+
export declare function AddressAvatar({ address, role, }: AddressAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { AddressLabel } from './addressLabel';
|
|
3
|
+
export interface AddressPartyProps {
|
|
4
|
+
address: Address;
|
|
5
|
+
/** Optional resolved label; controls the displayed name and avatar. */
|
|
6
|
+
label?: AddressLabel;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* One side of a transfer: an avatar plus a name (the resolved label, when
|
|
10
|
+
* present) and the shortened, copyable address. The copy affordance sits on the
|
|
11
|
+
* address line itself (not centered against the whole block). Purely
|
|
12
|
+
* presentational; labels are resolved by the caller.
|
|
13
|
+
*/
|
|
14
|
+
export declare function AddressParty({ address, label }: AddressPartyProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
export interface AddressRowProps {
|
|
3
|
+
label: string;
|
|
4
|
+
address: Address;
|
|
5
|
+
}
|
|
6
|
+
/** A labeled row showing a shortened, copyable address. */
|
|
7
|
+
export declare function AddressRow({ label, address }: AddressRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface AmountRowToken {
|
|
2
|
+
symbol: string;
|
|
3
|
+
decimals: number;
|
|
4
|
+
}
|
|
5
|
+
export interface AmountRowProps {
|
|
6
|
+
value: bigint | string | number;
|
|
7
|
+
token: AmountRowToken;
|
|
8
|
+
/** Row label shown on the left. */
|
|
9
|
+
label?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A two-column row: a label on the left and a token amount (icon + formatted
|
|
13
|
+
* value + symbol) on the right.
|
|
14
|
+
*/
|
|
15
|
+
export declare function AmountRow({ value, token, label }: AmountRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface CollapsibleCardProps {
|
|
3
|
+
/** Unique value identifying the accordion item within the card. */
|
|
4
|
+
value: string;
|
|
5
|
+
/** Header title, rendered inside a `CardTitle`. */
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the card is expanded by default.
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
/** Extra classes merged into the content wrapper (default `flex flex-col gap-3 pt-0`). */
|
|
13
|
+
contentClassName?: string;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Collapsible card shell: a `Card` wrapping a single-item `SimpleAccordion`
|
|
18
|
+
* whose header is the `title` and whose body is `children`. Encapsulates the
|
|
19
|
+
* repeated `Card -> SimpleAccordion -> SimpleAccordionItem` pattern used across
|
|
20
|
+
* the decode feature cards.
|
|
21
|
+
*/
|
|
22
|
+
export declare function CollapsibleCard({ value, title, defaultOpen, contentClassName, children, }: CollapsibleCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface SectionDividerProps {
|
|
2
|
+
/** Section heading rendered between the two separator rules. */
|
|
3
|
+
title: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A labeled divider: a centered, uppercase heading flanked by horizontal rules.
|
|
7
|
+
* Used to introduce a section inside an operation card (e.g. "Transfers" or the
|
|
8
|
+
* per-address balance groups in the state-changes card).
|
|
9
|
+
*/
|
|
10
|
+
export declare function SectionDivider({ title }: SectionDividerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { AddressLabels } from './addressLabel';
|
|
3
|
+
import { Transfer, TransferListToken } from './TransferRow';
|
|
4
|
+
export interface TransferListProps {
|
|
5
|
+
transfers: Transfer[];
|
|
6
|
+
/** Resolved labels for the involved addresses (drives names, avatars, color). */
|
|
7
|
+
labels: AddressLabels;
|
|
8
|
+
/** Resolves token metadata (symbol/decimals) for a token address. */
|
|
9
|
+
resolveToken: (token: Address) => TransferListToken;
|
|
10
|
+
/** Section heading shown in the divider; pass `null` to omit it. */
|
|
11
|
+
title?: string | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Renders a list of {@link TransferRow}s, separated from the rest of the card by
|
|
15
|
+
* a labeled divider. All rows share one symmetric five-column grid so the
|
|
16
|
+
* arrows, amounts and avatars align across rows. Renders nothing when there are
|
|
17
|
+
* no transfers.
|
|
18
|
+
*/
|
|
19
|
+
export declare function TransferList({ transfers, labels, resolveToken, title, }: TransferListProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { AddressLabels } from './addressLabel';
|
|
3
|
+
export interface TransferListToken {
|
|
4
|
+
symbol: string;
|
|
5
|
+
decimals: number;
|
|
6
|
+
}
|
|
7
|
+
export interface Transfer {
|
|
8
|
+
token: Address;
|
|
9
|
+
amount: bigint;
|
|
10
|
+
from: Address;
|
|
11
|
+
to: Address;
|
|
12
|
+
}
|
|
13
|
+
export interface TransferRowProps {
|
|
14
|
+
transfer: Transfer;
|
|
15
|
+
/** Resolved labels for the involved addresses (drives names, avatars, color). */
|
|
16
|
+
labels: AddressLabels;
|
|
17
|
+
token: TransferListToken;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* One transfer as five grid cells (the parent `TransferList` owns the shared,
|
|
21
|
+
* left-right symmetric grid template so columns line up across rows): sender,
|
|
22
|
+
* arrow, token amount, arrow, receiver. Sender/receiver are left-aligned in the
|
|
23
|
+
* flexible outer columns; the centered amount sits at the row's horizontal
|
|
24
|
+
* center with the two arrows symmetric around it. The arrows and amount are
|
|
25
|
+
* colored by direction relative to "our" addresses: red when an owned address
|
|
26
|
+
* is the sender (outgoing), green when it is the receiver (incoming), muted
|
|
27
|
+
* otherwise. Purely presentational; labels/token metadata are resolved by the
|
|
28
|
+
* caller.
|
|
29
|
+
*/
|
|
30
|
+
export declare function TransferRow({ transfer, labels, token }: TransferRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Visual category for a labeled address; drives the avatar rendering.
|
|
4
|
+
* `external` is the fallback for addresses we do not specifically recognize.
|
|
5
|
+
*/
|
|
6
|
+
export type AddressRole = "wallet" | "creditAccount" | "pool" | "external";
|
|
7
|
+
/**
|
|
8
|
+
* UI-only description of an address involved in an operation.
|
|
9
|
+
*
|
|
10
|
+
* `ours` is a presentation-layer concept (it colors transfers red/green) and is
|
|
11
|
+
* derived by the feature that builds the labels; it is intentionally decoupled
|
|
12
|
+
* from the simulation watch set in `src/simulate`.
|
|
13
|
+
*/
|
|
14
|
+
export interface AddressLabel {
|
|
15
|
+
/** Label shown in transfer rows, e.g. "Your wallet", "LP shares receiver", "Pool XYZ". */
|
|
16
|
+
transferLabel?: string;
|
|
17
|
+
/** Label shown as the state-changes divider, e.g. "Wallet balances", "Receiver balances". */
|
|
18
|
+
balancesLabel?: string;
|
|
19
|
+
/** Visual category, drives the avatar. */
|
|
20
|
+
role: AddressRole;
|
|
21
|
+
/** Whether this is one of "our" addresses; drives transfer color (red/green). */
|
|
22
|
+
ours: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** Address -> label lookup, keyed by checksummed address. */
|
|
25
|
+
export type AddressLabels = ReadonlyMap<Address, AddressLabel>;
|
|
26
|
+
/** Resolves an address's label, normalizing the key to checksummed form. */
|
|
27
|
+
export declare function getAddressLabel(labels: AddressLabels, address: Address): AddressLabel | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './AddressAvatar';
|
|
2
|
+
export * from './AddressParty';
|
|
3
|
+
export * from './AddressRow';
|
|
4
|
+
export * from './AmountRow';
|
|
5
|
+
export * from './addressLabel';
|
|
6
|
+
export * from './CollapsibleCard';
|
|
7
|
+
export * from './SectionDivider';
|
|
8
|
+
export * from './TransferList';
|
|
9
|
+
export * from './TransferRow';
|
package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TransactionExecutionStepLabelKey, TransactionExecutionStepView } from '../stepper';
|
|
3
|
+
export interface TransactionConfirmDialogViewProps {
|
|
4
|
+
readonly open: boolean;
|
|
5
|
+
readonly onClose: () => void;
|
|
6
|
+
readonly title: React.ReactNode;
|
|
7
|
+
readonly preview: React.ReactNode;
|
|
8
|
+
readonly previewLoading?: boolean;
|
|
9
|
+
readonly previewError?: Error | null;
|
|
10
|
+
readonly previewErrorTitle?: string;
|
|
11
|
+
readonly execution: React.ReactNode;
|
|
12
|
+
readonly steps: ReadonlyArray<TransactionExecutionStepView>;
|
|
13
|
+
readonly renderStepLabel: (labelKey: TransactionExecutionStepLabelKey) => React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function TransactionConfirmDialogView({ open, onClose, title, preview, previewLoading, previewError, previewErrorTitle, execution, steps, renderStepLabel, }: TransactionConfirmDialogViewProps): React.ReactElement | null;
|
package/dist/types/components/composites/tx-preview/confirm/dialog/useTransactionConfirmDialog.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface UseTransactionConfirmDialogReturn {
|
|
2
|
+
open: boolean;
|
|
3
|
+
openDialog: () => void;
|
|
4
|
+
closeDialog: () => void;
|
|
5
|
+
refreshNonce: number;
|
|
6
|
+
bumpRefreshNonce: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useTransactionConfirmDialog(): UseTransactionConfirmDialogReturn;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useCalldataOperationPreview';
|
package/dist/types/components/composites/tx-preview/confirm/hooks/useCalldataOperationPreview.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Operation, PoolSimulationResult } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { Address, Hex } from 'viem';
|
|
3
|
+
import { GearboxSDKLike } from '../../types';
|
|
4
|
+
export interface UseCalldataOperationPreviewInput {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
sdk: GearboxSDKLike | undefined;
|
|
7
|
+
to: Address | undefined;
|
|
8
|
+
calldata: Hex | undefined;
|
|
9
|
+
wallet: Address | undefined;
|
|
10
|
+
refreshNonce: number;
|
|
11
|
+
}
|
|
12
|
+
export interface UseCalldataOperationPreviewResult {
|
|
13
|
+
operation: Operation | undefined;
|
|
14
|
+
simulation: PoolSimulationResult | undefined;
|
|
15
|
+
isSimulating: boolean;
|
|
16
|
+
parseError: Error | null;
|
|
17
|
+
isReady: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function useCalldataOperationPreview({ enabled, sdk, to, calldata, wallet, refreshNonce, }: UseCalldataOperationPreviewInput): UseCalldataOperationPreviewResult;
|
package/dist/types/components/composites/tx-preview/confirm/preview/OperationPreviewContent.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Operation, PoolSimulationResult } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { Address } from 'viem';
|
|
4
|
+
import { GearboxSDKLike } from '../../types';
|
|
5
|
+
export interface OperationPreviewContentProps {
|
|
6
|
+
sdk: GearboxSDKLike;
|
|
7
|
+
operation: Operation;
|
|
8
|
+
simulation: PoolSimulationResult | undefined;
|
|
9
|
+
isSimulating: boolean;
|
|
10
|
+
wallet: Address;
|
|
11
|
+
refreshNonce: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function OperationPreviewContent({ sdk, operation, simulation, isSimulating, wallet, refreshNonce, }: OperationPreviewContentProps): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './OperationPreviewContent';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TransactionExecutionStepLabelKey, TransactionExecutionStepView } from './computeTransactionExecutionSteps';
|
|
3
|
+
export interface HorizontalTransactionStepperProps {
|
|
4
|
+
readonly steps: ReadonlyArray<TransactionExecutionStepView>;
|
|
5
|
+
readonly renderLabel: (labelKey: TransactionExecutionStepLabelKey) => React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function HorizontalTransactionStepper({ steps, renderLabel, }: HorizontalTransactionStepperProps): React.ReactElement;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type TransactionExecutionStepId = "connect" | "network" | "approve" | "execute";
|
|
2
|
+
export type StepStatus = "completed" | "active" | "upcoming";
|
|
3
|
+
export type TransactionExecutionStepLabelKey = "connect" | "network" | "approve" | "approveBatch" | "execute";
|
|
4
|
+
export interface TransactionExecutionStepInput {
|
|
5
|
+
isConnected: boolean;
|
|
6
|
+
isCorrectChain: boolean;
|
|
7
|
+
isAuthReady: boolean;
|
|
8
|
+
needsApproval: boolean;
|
|
9
|
+
isApprovalPending: boolean;
|
|
10
|
+
allowWalletBatching: boolean;
|
|
11
|
+
isExecuting?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface TransactionExecutionStepView {
|
|
14
|
+
id: TransactionExecutionStepId;
|
|
15
|
+
labelKey: TransactionExecutionStepLabelKey;
|
|
16
|
+
status: StepStatus;
|
|
17
|
+
}
|
|
18
|
+
export declare function computeTransactionExecutionSteps(input: TransactionExecutionStepInput): {
|
|
19
|
+
steps: TransactionExecutionStepView[];
|
|
20
|
+
activeStepId: TransactionExecutionStepId;
|
|
21
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Operation, PoolSimulationResult } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { Address, Hex } from 'viem';
|
|
3
|
+
import { GearboxSDKLike } from '../types';
|
|
4
|
+
export interface ParsedTransactionInput {
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
sdk: GearboxSDKLike;
|
|
7
|
+
to: Address;
|
|
8
|
+
calldata: Hex;
|
|
9
|
+
sender: Address;
|
|
10
|
+
refreshNonce?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface UseParsedTransactionResult {
|
|
13
|
+
/**
|
|
14
|
+
* Parsed operation. For pool operations it is enriched with wallet transfers
|
|
15
|
+
* once the simulation stage succeeds, triggering a re-render.
|
|
16
|
+
*/
|
|
17
|
+
data: Operation | undefined;
|
|
18
|
+
/** Stage-1 (parse) error, if decoding the calldata threw. */
|
|
19
|
+
error: Error | null;
|
|
20
|
+
/**
|
|
21
|
+
* Stage-2 simulation outcome. `undefined` while it is loading or for
|
|
22
|
+
* operations that are not simulated (currently anything but pool ops).
|
|
23
|
+
*/
|
|
24
|
+
simulation: PoolSimulationResult | undefined;
|
|
25
|
+
/** Stage-2 (simulation) loading flag. */
|
|
26
|
+
isSimulating: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Resolves the {@link Operation} for the given input in two stages:
|
|
30
|
+
*
|
|
31
|
+
* 1. Parse the raw calldata (synchronous decode, no chain reads).
|
|
32
|
+
* 2. For pool operations, simulate the call to recover wallet transfers and
|
|
33
|
+
* balance changes. On success the transfers are merged back into the parsed
|
|
34
|
+
* operation; on revert the decoded reason is exposed via `simulation`.
|
|
35
|
+
*
|
|
36
|
+
* Stage 1 is a pure synchronous decode, so it runs in a `useMemo`; only the
|
|
37
|
+
* simulation (stage 2) is a real async operation backed by React Query (keyed
|
|
38
|
+
* so results cache per decoded call and wallet).
|
|
39
|
+
*/
|
|
40
|
+
export declare function useParsedTransaction(input: ParsedTransactionInput): UseParsedTransactionResult;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transaction preview + confirm flow (WIP).
|
|
3
|
+
*
|
|
4
|
+
* Intentionally NOT re-exported from the main `@gearbox-protocol/ui-kit` entry or
|
|
5
|
+
* `components/composites/index.ts`. The module is still in development; its final
|
|
6
|
+
* scope, API shape, and completion timeline are not settled yet.
|
|
7
|
+
*
|
|
8
|
+
* Consumers should import only via `@gearbox-protocol/ui-kit/tx-preview` (and documented
|
|
9
|
+
* deep subpaths). Merging into the root ui-kit barrel is a separate decision once
|
|
10
|
+
* the module is stable.
|
|
11
|
+
*/
|
|
12
|
+
export * from './components';
|
|
13
|
+
export * from './confirm';
|
|
14
|
+
export * from './hooks/useParsedTransaction';
|
|
15
|
+
export * from './operations';
|
|
16
|
+
export * from './prerequisites';
|
|
17
|
+
export * from './state-change';
|
|
18
|
+
export * from './types';
|
|
19
|
+
export * from './utils';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Operation } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { Address } from 'viem';
|
|
3
|
+
import { GearboxSDKLike } from '../types';
|
|
4
|
+
export interface OperationBodyProps {
|
|
5
|
+
sdk: GearboxSDKLike;
|
|
6
|
+
operation: Operation;
|
|
7
|
+
/** Wallet whose transfers are highlighted; populated after simulation. */
|
|
8
|
+
wallet: Address;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Renders the body of the outer operation (rows only, no card chrome).
|
|
12
|
+
* Currently handles pool deposit/redeem; credit-facade operations
|
|
13
|
+
* ({@link OuterFacadeOperation}) are a future branch.
|
|
14
|
+
*/
|
|
15
|
+
export declare function OperationBody({ sdk, operation, wallet }: OperationBodyProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Operation } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { Address } from 'viem';
|
|
3
|
+
import { GearboxSDKLike } from '../types';
|
|
4
|
+
export interface OperationsCardProps {
|
|
5
|
+
sdk: GearboxSDKLike;
|
|
6
|
+
transaction: Operation;
|
|
7
|
+
wallet: Address;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Whether a dedicated custom operation view exists for the parsed transaction.
|
|
11
|
+
* Drives both whether {@link OperationsCard} renders and whether the raw
|
|
12
|
+
* transaction card starts expanded. Currently only pool operations have a view.
|
|
13
|
+
*/
|
|
14
|
+
export declare function hasOperationView(tx: Operation): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Collapsible card (open by default) for a decoded transaction. Renders the
|
|
17
|
+
* outer operation in its content. Pool operations have no inner operations, so
|
|
18
|
+
* the card body is just the operation rows; credit-facade operations will later
|
|
19
|
+
* render their {@link InnerOperation}s as nested non-collapsible cards here.
|
|
20
|
+
*/
|
|
21
|
+
export declare function OperationsCard({ sdk, transaction, wallet, }: OperationsCardProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PoolDepositOperation } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { Address } from 'viem';
|
|
3
|
+
import { GearboxSDKLike } from '../types';
|
|
4
|
+
export interface PoolDepositViewProps {
|
|
5
|
+
sdk: GearboxSDKLike;
|
|
6
|
+
operation: PoolDepositOperation;
|
|
7
|
+
/** Wallet whose transfers are highlighted; populated after simulation. */
|
|
8
|
+
wallet: Address;
|
|
9
|
+
}
|
|
10
|
+
/** Human-readable body of a Gearbox pool deposit operation (rows only). */
|
|
11
|
+
export declare function PoolDepositView({ sdk, operation, wallet, }: PoolDepositViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { TokenInfo } from '../utils';
|
|
3
|
+
export interface PoolRowProps {
|
|
4
|
+
pool: TokenInfo;
|
|
5
|
+
address: Address;
|
|
6
|
+
}
|
|
7
|
+
/** Pool row: shows the pool's human label plus the copyable pool address. */
|
|
8
|
+
export declare function PoolRow({ pool, address }: PoolRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PoolRedeemOperation } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { Address } from 'viem';
|
|
3
|
+
import { GearboxSDKLike } from '../types';
|
|
4
|
+
export interface PoolWithdrawViewProps {
|
|
5
|
+
sdk: GearboxSDKLike;
|
|
6
|
+
operation: PoolRedeemOperation;
|
|
7
|
+
/** Wallet whose transfers are highlighted; populated after simulation. */
|
|
8
|
+
wallet: Address;
|
|
9
|
+
}
|
|
10
|
+
/** Human-readable body of a Gearbox pool withdraw (redeem) operation (rows only). */
|
|
11
|
+
export declare function PoolWithdrawView({ sdk, operation, wallet, }: PoolWithdrawViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AnyPrerequisiteResult } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { GearboxSDKLike } from '../types';
|
|
3
|
+
export interface PrerequisiteRowProps {
|
|
4
|
+
result: AnyPrerequisiteResult;
|
|
5
|
+
sdk: GearboxSDKLike;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* One prerequisite as a labeled row: a status icon + title on the left and the
|
|
9
|
+
* kind-specific detail (or the revert reason on error) on the right.
|
|
10
|
+
*/
|
|
11
|
+
export declare function PrerequisiteRow({ result, sdk }: PrerequisiteRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Operation } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { Address } from 'viem';
|
|
3
|
+
import { GearboxSDKLike } from '../types';
|
|
4
|
+
export interface PrerequisitesCardProps {
|
|
5
|
+
sdk: GearboxSDKLike;
|
|
6
|
+
operation: Operation;
|
|
7
|
+
/** Transaction sender whose balances/allowances are verified. */
|
|
8
|
+
wallet: Address;
|
|
9
|
+
blockNumber?: bigint;
|
|
10
|
+
/** Shared re-evaluation trigger; forwarded to keep one cache key. */
|
|
11
|
+
refreshNonce?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Verifies and lists the on-chain prerequisites for an operation, one status
|
|
15
|
+
* row per check. Renders nothing when the operation has no prerequisites.
|
|
16
|
+
*/
|
|
17
|
+
export declare function PrerequisitesCard({ sdk, operation, wallet, blockNumber, refreshNonce, }: PrerequisitesCardProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AnyPrerequisiteResult, PrerequisiteDetail, PrerequisiteKind } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { GearboxSDKLike } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Renderer per {@link PrerequisiteKind}. The mapped-type signature forces an
|
|
6
|
+
* entry for every kind, so adding a new prerequisite kind fails to compile
|
|
7
|
+
* until its detail renderer is provided here.
|
|
8
|
+
*/
|
|
9
|
+
export declare const prerequisiteDetailRenderers: {
|
|
10
|
+
[K in PrerequisiteKind]: (detail: PrerequisiteDetail<K>, sdk: GearboxSDKLike) => ReactNode;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Renders the kind-specific detail for a prerequisite result. The cast bridges
|
|
14
|
+
* the correlated `kind`/`detail` pair to the registry's per-kind signature;
|
|
15
|
+
* the runtime pairing is guaranteed by how results are constructed.
|
|
16
|
+
*/
|
|
17
|
+
export declare function renderPrerequisiteDetail(result: AnyPrerequisiteResult, sdk: GearboxSDKLike): ReactNode;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Operation } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { Address } from 'viem';
|
|
3
|
+
import { GearboxSDKLike } from '../types';
|
|
4
|
+
export interface UsePrerequisitesInput {
|
|
5
|
+
sdk: GearboxSDKLike;
|
|
6
|
+
operation: Operation;
|
|
7
|
+
/** Transaction sender whose balances/allowances are verified. */
|
|
8
|
+
wallet: Address;
|
|
9
|
+
/** Block to read at; defaults to latest. Only set for testnet forks. */
|
|
10
|
+
blockNumber?: bigint;
|
|
11
|
+
/**
|
|
12
|
+
* Bumped by the submit flow after each on-chain action (e.g. an approval
|
|
13
|
+
* confirms) to force an immediate re-verification. Included in the query key
|
|
14
|
+
* so all consumers sharing the same key re-evaluate together.
|
|
15
|
+
*/
|
|
16
|
+
refreshNonce?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Builds and verifies the on-chain prerequisites for a parsed operation.
|
|
20
|
+
*
|
|
21
|
+
* Keyed on the serialized operation, wallet and block so results are cached per
|
|
22
|
+
* decoded call. Mirrors {@link import("./useParsedTransaction")} conventions:
|
|
23
|
+
* results never go stale and failed runs are not retried.
|
|
24
|
+
*/
|
|
25
|
+
export declare function usePrerequisites({ sdk, operation, wallet, blockNumber, refreshNonce, }: UsePrerequisitesInput): import('@tanstack/react-query').UseQueryResult<import('@gearbox-protocol/sdk/preview').AnyPrerequisiteResult[], Error>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AddressBalanceChanges } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { AddressLabels } from '../components';
|
|
3
|
+
import { GearboxSDKLike } from '../types';
|
|
4
|
+
export interface BalanceChangeGroupProps {
|
|
5
|
+
sdk: GearboxSDKLike;
|
|
6
|
+
group: AddressBalanceChanges;
|
|
7
|
+
/** Resolved labels for the involved addresses (drives the group divider). */
|
|
8
|
+
labels: AddressLabels;
|
|
9
|
+
}
|
|
10
|
+
/** One labeled section of balance changes for a single address. */
|
|
11
|
+
export declare function BalanceChangeGroup({ sdk, group, labels, }: BalanceChangeGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TokenBalanceChange } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { GearboxSDKLike } from '../types';
|
|
3
|
+
export interface BalanceChangeRowProps {
|
|
4
|
+
sdk: GearboxSDKLike;
|
|
5
|
+
change: TokenBalanceChange;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* One token balance change as three grid cells (the parent group owns the shared
|
|
9
|
+
* grid template so columns line up across rows): the token (symbol + name,
|
|
10
|
+
* left-aligned and flexible), the struck-through before value with an arrow to
|
|
11
|
+
* the after value, and the signed diff in brackets. The whole row is colored
|
|
12
|
+
* green for a positive delta and red for a negative one.
|
|
13
|
+
*/
|
|
14
|
+
export declare function BalanceChangeRow({ sdk, change }: BalanceChangeRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AddressBalanceChanges, PoolOperation } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { Address } from 'viem';
|
|
3
|
+
import { GearboxSDKLike } from '../types';
|
|
4
|
+
export interface PoolStateChangeCardProps {
|
|
5
|
+
sdk: GearboxSDKLike;
|
|
6
|
+
/** The decoded pool deposit/redeem operation. */
|
|
7
|
+
operation: PoolOperation;
|
|
8
|
+
/** Balance changes grouped by watched address (from a successful simulation). */
|
|
9
|
+
balanceChanges: AddressBalanceChanges[];
|
|
10
|
+
/** Wallet whose balances are highlighted. */
|
|
11
|
+
wallet: Address;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Pool-specific state-change content: balance changes grouped by address (wallet
|
|
15
|
+
* and, when distinct, the recipient). Renders content only; the surrounding card
|
|
16
|
+
* chrome, loading, and error handling live in {@link StateChangeCard}.
|
|
17
|
+
*/
|
|
18
|
+
export declare function PoolStateChangeCard({ sdk, operation, balanceChanges, wallet, }: PoolStateChangeCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Operation, PoolSimulationResult } from '@gearbox-protocol/sdk/preview';
|
|
2
|
+
import { Address } from 'viem';
|
|
3
|
+
import { GearboxSDKLike } from '../types';
|
|
4
|
+
export interface StateChangeCardProps {
|
|
5
|
+
sdk: GearboxSDKLike;
|
|
6
|
+
/** Parsed operation that drives which specific state-change card is shown. */
|
|
7
|
+
data: Operation;
|
|
8
|
+
/** Stage-2 simulation outcome; `undefined` while it is loading. */
|
|
9
|
+
simulation: PoolSimulationResult | undefined;
|
|
10
|
+
/** Whether the simulation is still running. */
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
/** Wallet whose balances/transfers are highlighted. */
|
|
13
|
+
wallet: Address;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Parent card for transaction state changes. Owns the common logic (collapsible
|
|
17
|
+
* card shell, loading skeleton, card-styled error, and no-data handling) and
|
|
18
|
+
* decides which specific state-change card to render: pool balance changes,
|
|
19
|
+
* credit account changes (not yet supported), or the decoded revert reason.
|
|
20
|
+
*/
|
|
21
|
+
export declare function StateChangeCard({ sdk, data, simulation, isLoading, wallet, }: StateChangeCardProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Minimal SDK surface for tx-preview UI + hooks.
|
|
4
|
+
* Satisfied by verify OnchainSDK and client preview SDK instances.
|
|
5
|
+
*/
|
|
6
|
+
export interface GearboxSDKLike {
|
|
7
|
+
chainId: number;
|
|
8
|
+
tokensMeta: {
|
|
9
|
+
get(address: Address): {
|
|
10
|
+
symbol?: string;
|
|
11
|
+
decimals?: number;
|
|
12
|
+
name?: string;
|
|
13
|
+
} | undefined;
|
|
14
|
+
};
|
|
15
|
+
readonly plugins: {
|
|
16
|
+
adapters: unknown;
|
|
17
|
+
};
|
|
18
|
+
client: unknown;
|
|
19
|
+
}
|