Skip to content

Commit

Permalink
[Chore] Add type annotations to SwapFees and SwapTransactionsScreen c…
Browse files Browse the repository at this point in the history
…omponents (#3508)
  • Loading branch information
jnsdls authored Jun 26, 2024
1 parent fbb1493 commit 2dac941
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export function SwapFees(props: {
alignItems: props.align === "right" ? "flex-end" : "flex-start",
}}
>
{props.quote.processingFees.map((fee, i) => {
{/* TODO: why are the explicit annotations required here? */}
{props.quote.processingFees.map((fee: BuyWithCryptoQuote['processingFees'][number], i: number) => {
const feeAmount = formatNumber(Number(fee.amount), 4);
return (
<Container key={i} flex="row" gap="xxs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export function SwapTransactionsScreen(props: { onBack: () => void }) {
const txInfosToShow: TxStatusInfo[] = [];

const txHashSet = new Set<string>();
_historyQuery.data?.page.forEach((tx) => {
// TODO: why is the annotation required here?
_historyQuery.data?.page.forEach((tx: BuyWithCryptoStatus) => {
if (tx.status !== "NOT_FOUND" && tx.status !== "NONE") {
if (tx.source?.transactionHash) {
txHashSet.add(tx.source?.transactionHash);
Expand Down Expand Up @@ -84,7 +85,8 @@ export function SwapTransactionsScreen(props: { onBack: () => void }) {
});

// Add data from endpoint
_historyQuery.data?.page.forEach((tx) => {
// TODO: why is the annotation required here?
_historyQuery.data?.page.forEach((tx: BuyWithCryptoStatus) => {
if (tx.status !== "NOT_FOUND" && tx.status !== "NONE") {
if (tx.source?.transactionHash) {
txInfosToShow.push({
Expand Down

0 comments on commit 2dac941

Please sign in to comment.