From 325778da4d0428f80e6e058eee69fefd2531e0a1 Mon Sep 17 00:00:00 2001 From: hueso Date: Thu, 26 Jun 2025 12:11:13 -0300 Subject: [PATCH] more type fixes --- src/blockchain/addresses.ts | 2 +- .../ListingComponent/ListingComponent.vue | 2 +- src/model/WalletTransaction.ts | 6 +++-- src/model/mock/WalletTransactionMock.ts | 26 +++++++++---------- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/blockchain/addresses.ts b/src/blockchain/addresses.ts index 51fd8f0..6b997d2 100644 --- a/src/blockchain/addresses.ts +++ b/src/blockchain/addresses.ts @@ -14,7 +14,7 @@ const Tokens: { [key in NetworkEnum]: { [key in TokenEnum]: `0x${string}` } } = }, }; -export const getTokenByAddress = (address: string) => { +export const getTokenByAddress = (address: `0x${string}`) => { const user = useUser(); const networksTokens = Tokens[user.networkName.value]; for (const [token, tokenAddress] of Object.entries(networksTokens)) { diff --git a/src/components/ListingComponent/ListingComponent.vue b/src/components/ListingComponent/ListingComponent.vue index 9a5e21f..1cfcd82 100644 --- a/src/components/ListingComponent/ListingComponent.vue +++ b/src/components/ListingComponent/ListingComponent.vue @@ -409,7 +409,7 @@ p { } input[type="number"] { - -moz-appearance: textfield; + appearance: textfield; } input[type="number"]::-webkit-inner-spin-button, diff --git a/src/model/WalletTransaction.ts b/src/model/WalletTransaction.ts index 1739aa5..9cc6ca2 100644 --- a/src/model/WalletTransaction.ts +++ b/src/model/WalletTransaction.ts @@ -1,11 +1,13 @@ +import { LockStatus } from "@/blockchain/events" + export type WalletTransaction = { - token: string; + token: `0x${string}`; blockNumber: number; amount: number; seller: string; buyer: string; event: string; - lockStatus: number; + lockStatus: LockStatus; transactionHash: string; transactionID?: string; }; diff --git a/src/model/mock/WalletTransactionMock.ts b/src/model/mock/WalletTransactionMock.ts index 3cab827..e049a32 100644 --- a/src/model/mock/WalletTransactionMock.ts +++ b/src/model/mock/WalletTransactionMock.ts @@ -3,47 +3,47 @@ import type { WalletTransaction } from "../WalletTransaction"; export const MockWalletTransactions: WalletTransaction[] = [ { blockNumber: 1, - token: "1", + token: "0x1", amount: 70, - seller: "mockedSellerAddress", - buyer: "mockedBuyerAddress", + seller: "0xmockedSellerAddress", + buyer: "0xmockedBuyerAddress", event: "Deposit", lockStatus: 0, transactionHash: "1", }, { blockNumber: 2, - token: "2", + token: "0x2", amount: 200, - seller: "mockedSellerAddress", - buyer: "mockedBuyerAddress", + seller: "0xmockedSellerAddress", + buyer: "0xmockedBuyerAddress", event: "Lock", lockStatus: 1, transactionHash: "2", }, { blockNumber: 3, - token: "3", + token: "0x3", amount: 1250, - seller: "mockedSellerAddress", - buyer: "mockedBuyerAddress", + seller: "0xmockedSellerAddress", + buyer: "0xmockedBuyerAddress", event: "Release", lockStatus: 2, transactionHash: "3", }, { blockNumber: 4, - token: "4", + token: "0x4", amount: 4000, - seller: "mockedSellerAddress", - buyer: "mockedBuyerAddress", + seller: "0xmockedSellerAddress", + buyer: "0xmockedBuyerAddress", event: "Deposit", lockStatus: 0, transactionHash: "4", }, { blockNumber: 5, - token: "5", + token: "0x5", amount: 2000, seller: "mockedSellerAddress", buyer: "mockedBuyerAddress",