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:
@@ -1,15 +1,11 @@
|
||||
import { getContract } from "./provider";
|
||||
import { ChainContract } from "viem";
|
||||
import {
|
||||
parseEther,
|
||||
type Address,
|
||||
type TransactionReceipt,
|
||||
} from "viem";
|
||||
import { parseEther, type Address, type TransactionReceipt } from "viem";
|
||||
|
||||
export const addLock = async (
|
||||
sellerAddress: Address,
|
||||
tokenAddress: Address,
|
||||
amount: number
|
||||
amount: number,
|
||||
): Promise<bigint> => {
|
||||
const { address, abi, wallet, client, account } = await getContract();
|
||||
const parsedAmount = parseEther(amount.toString());
|
||||
@@ -36,7 +32,7 @@ export const addLock = async (
|
||||
|
||||
export const withdrawDeposit = async (
|
||||
amount: string,
|
||||
token: Address
|
||||
token: Address,
|
||||
): Promise<boolean> => {
|
||||
const { address, abi, wallet, client, account } = await getContract();
|
||||
|
||||
@@ -49,7 +45,7 @@ export const withdrawDeposit = async (
|
||||
abi,
|
||||
functionName: "withdraw",
|
||||
args: [token, parseEther(amount), []],
|
||||
account
|
||||
account,
|
||||
});
|
||||
|
||||
const hash = await wallet.writeContract(request);
|
||||
@@ -60,8 +56,8 @@ export const withdrawDeposit = async (
|
||||
|
||||
export const releaseLock = async (
|
||||
lockID: bigint,
|
||||
pixTimestamp: `0x${string}`&{lenght:34},
|
||||
signature: `0x${string}`
|
||||
pixTimestamp: `0x${string}` & { lenght: 34 },
|
||||
signature: `0x${string}`,
|
||||
): Promise<TransactionReceipt> => {
|
||||
const { address, abi, wallet, client, account } = await getContract();
|
||||
|
||||
@@ -74,7 +70,7 @@ export const releaseLock = async (
|
||||
abi,
|
||||
functionName: "release",
|
||||
args: [BigInt(lockID), pixTimestamp, signature],
|
||||
account
|
||||
account,
|
||||
});
|
||||
|
||||
const hash = await wallet.writeContract(request);
|
||||
|
||||
Reference in New Issue
Block a user