Skip to content

Commit

Permalink
add types, constants
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-defi committed Mar 4, 2025
1 parent 40f4f2b commit bd026f1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 38 deletions.
1 change: 1 addition & 0 deletions src/wallet/components/wallet-advanced-send/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const ETH_REQUIRED_FOR_SEND = 0.000001;
61 changes: 23 additions & 38 deletions src/wallet/components/wallet-advanced-send/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import type { Dispatch, ReactNode, SetStateAction } from 'react';
import type { Address, TransactionReceipt } from 'viem';
import type { Address, Chain, TransactionReceipt } from 'viem';
import type { APIError, PortfolioTokenWithFiatValue } from '../../../api/types';
import type { LifecycleStatusUpdate } from '../../../internal/types';
import type { Call } from '../../../transaction/types';

export type SendReact = {
children?: ReactNode;
className?: string;
};

export type SendProviderReact = {
children: ReactNode;
};
Expand All @@ -21,7 +26,7 @@ export type SendContextType = {

// Sender Context
/** The balance of the sender's ETH wallet */
ethBalance: number | undefined;
ethBalance: number;

// Recipient Address Context
/** The selected recipient address */
Expand Down Expand Up @@ -122,47 +127,27 @@ export type SendLifecycleStatus =
statusData: APIError;
};

export type SendAmountInputProps = {
className?: string;
textClassName?: string;
} & Pick<
SendContextType,
| 'selectedToken'
| 'cryptoAmount'
| 'handleCryptoAmountChange'
| 'fiatAmount'
| 'handleFiatAmountChange'
| 'selectedInputType'
| 'setSelectedInputType'
| 'exchangeRate'
| 'exchangeRateLoading'
>;

export type SendFundingWalletProps = {
onError?: () => void;
onStatus?: () => void;
onSuccess?: () => void;
export type SendAddressInputProps = {
selectedRecipientAddress: RecipientAddress;
recipientInput: string;
setRecipientInput: Dispatch<SetStateAction<string>>;
setValidatedInput: Dispatch<SetStateAction<RecipientAddress>>;
handleRecipientInputChange: () => void;
classNames?: {
container?: string;
subtitle?: string;
fundCard?: string;
label?: string;
input?: string;
};
};

export type SendTokenSelectorProps = {
export type SendAddressSelectorProps = {
address: Address | null;
senderChain: Chain | null | undefined;
handleClick: () => Promise<void>;
classNames?: {
container?: string;
tokenName?: string;
tokenValue?: string;
fiatValue?: string;
action?: string;
avatar?: string;
name?: string;
address?: string;
};
} & Pick<
SendContextType,
| 'selectedToken'
| 'handleTokenSelection'
| 'handleResetTokenSelection'
| 'setSelectedInputType'
| 'handleCryptoAmountChange'
| 'handleFiatAmountChange'
>;
};

0 comments on commit bd026f1

Please sign in to comment.