refactor: clean up code formatting and improve readability across multiple components
- Standardized the use of quotes and spacing in various files. - Removed unnecessary line breaks and trailing spaces in components. - Improved the structure of computed properties and methods for better clarity. - Enhanced the consistency of prop definitions and emit events in Vue components. - Updated the GraphQL composable to streamline error handling and data processing. - Refactored network configuration files for better organization and readability. - Cleaned up model files by removing redundant lines and ensuring consistent formatting. - Adjusted router configuration for improved readability. - Enhanced utility functions for better maintainability and clarity.
This commit is contained in:
@@ -61,9 +61,11 @@ export const createSolicitation = async (offer: Offer) => {
|
||||
return response.json();
|
||||
};
|
||||
|
||||
export const getSolicitation = async (id: bigint): Promise<{pixTimestamp: `0x${string}`, signature: `0x${string}`}> => {
|
||||
export const getSolicitation = async (
|
||||
id: bigint,
|
||||
): Promise<{ pixTimestamp: `0x${string}`; signature: `0x${string}` }> => {
|
||||
const response = await fetch(
|
||||
`${import.meta.env.VITE_APP_API_URL}/release/${id}`
|
||||
`${import.meta.env.VITE_APP_API_URL}/release/${id}`,
|
||||
);
|
||||
|
||||
const obj = await response.json();
|
||||
|
||||
@@ -2,10 +2,14 @@ import type { TokenEnum } from "@/model/NetworkEnum";
|
||||
import { Networks } from "@/config/networks";
|
||||
|
||||
export const getNetworkImage = (networkName: string): string => {
|
||||
const normalizedName = networkName.toLowerCase().replace(/[^a-z0-9]/g, '-');
|
||||
return new URL(`../assets/networks/${normalizedName}.svg`, import.meta.url).href;
|
||||
const normalizedName = networkName.toLowerCase().replace(/[^a-z0-9]/g, "-");
|
||||
return new URL(`../assets/networks/${normalizedName}.svg`, import.meta.url)
|
||||
.href;
|
||||
};
|
||||
|
||||
export const getTokenImage = (tokenName: TokenEnum): string => {
|
||||
return new URL(`../assets/tokens/${tokenName.toLowerCase()}.svg`, import.meta.url).href;
|
||||
return new URL(
|
||||
`../assets/tokens/${tokenName.toLowerCase()}.svg`,
|
||||
import.meta.url,
|
||||
).href;
|
||||
};
|
||||
|
||||
@@ -4,14 +4,14 @@ import type { Address } from "viem";
|
||||
const verifyNetworkLiquidity = (
|
||||
tokenValue: number,
|
||||
walletAddress: Address,
|
||||
validDepositList: ValidDeposit[]
|
||||
validDepositList: ValidDeposit[],
|
||||
): ValidDeposit[] => {
|
||||
const filteredDepositList = validDepositList
|
||||
.filter((element) => {
|
||||
const remaining = element.remaining;
|
||||
if (
|
||||
tokenValue!! <= remaining &&
|
||||
tokenValue!! != 0 &&
|
||||
tokenValue! <= remaining &&
|
||||
tokenValue! != 0 &&
|
||||
element.seller !== walletAddress
|
||||
) {
|
||||
return true;
|
||||
@@ -25,14 +25,14 @@ const verifyNetworkLiquidity = (
|
||||
const uniqueNetworkDeposits = filteredDepositList.reduce(
|
||||
(acc: ValidDeposit[], current) => {
|
||||
const existingNetwork = acc.find(
|
||||
(deposit) => deposit.network === current.network
|
||||
(deposit) => deposit.network === current.network,
|
||||
);
|
||||
if (!existingNetwork) {
|
||||
acc.push(current);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
return uniqueNetworkDeposits;
|
||||
};
|
||||
|
||||
@@ -5,13 +5,13 @@ export const appVersions: AppVersion[] = [
|
||||
tag: "1.1.0",
|
||||
ipfsHash: "bafybeiaffdxrxoex3qh7kirnkkufnvpafb4gmkt7mjxufnnpbrq6tmqoha",
|
||||
releaseDate: "2025-11-06",
|
||||
description: "Explorer and versioning features added"
|
||||
description: "Explorer and versioning features added",
|
||||
},
|
||||
{
|
||||
tag: "1.0.0",
|
||||
ipfsHash: "bafybeiagfqnxnb5zdrks6dicfm7kxjdtzzzzm2ouluxgdseg2hrrotayzi",
|
||||
releaseDate: "2023-01-28",
|
||||
description: "Initial release"
|
||||
description: "Initial release",
|
||||
},
|
||||
];
|
||||
|
||||
@@ -26,5 +26,3 @@ export function getVersionByTag(tag: string): AppVersion | null {
|
||||
export function getIpfsUrl(ipfsHash: string): string {
|
||||
return `https://${ipfsHash}.ipfs.dweb.link`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user