From b0392a5f05db98e7676095b2202ccf2d21a7069f Mon Sep 17 00:00:00 2001 From: kehiy Date: Sun, 8 Sep 2024 11:53:42 +0330 Subject: [PATCH] style: format code --- src/App.css | 2 +- src/api/constant/index.ts | 8 +- src/api/services/Transaction.ts | 19 +- src/assets/icons/ArrowsUpDown.tsx | 4 +- src/assets/icons/BurgerIcon.tsx | 66 +- src/assets/icons/ChevronDown.tsx | 6 +- src/assets/icons/DiscordIcon.tsx | 36 +- src/assets/icons/GithubIcon.tsx | 1 - .../Home/TransferSection/TransferBoxes.tsx | 2 +- src/components/Home/TransferSection/abi.ts | 1259 ++++++++--------- src/components/Home/data.json | 15 +- src/components/Home/style.css | 8 +- src/components/TransactionMemo/CopyButton.tsx | 2 +- src/components/Transactions/companiesLogo.ts | 7 +- src/components/shared/Checkbox.tsx | 5 +- src/components/shared/ConnectButton.tsx | 2 +- src/components/shared/Link.tsx | 1 - src/components/shared/Select/index.tsx | 2 +- src/components/shared/TextField.tsx | 2 +- src/constants/enums/txEnums.ts | 6 +- src/index.css | 55 +- src/layout/BurgerMenu.tsx | 2 - src/lib/utils.ts | 42 +- src/main.tsx | 2 - src/pages/index.ts | 10 +- src/types/Transactions.ts | 2 +- src/types/apiResult.ts | 12 +- src/types/bridgeButton.ts | 2 +- src/wagmi/networks.ts | 39 +- src/wagmi/polyfills.ts | 4 +- src/wagmi/wagmi.ts | 15 +- tailwind.config.js | 15 +- vite.config.ts | 2 +- 33 files changed, 815 insertions(+), 840 deletions(-) diff --git a/src/App.css b/src/App.css index 5e1445c..7085230 100644 --- a/src/App.css +++ b/src/App.css @@ -7,4 +7,4 @@ left: 0; top: 0; z-index: -51; -} \ No newline at end of file +} diff --git a/src/api/constant/index.ts b/src/api/constant/index.ts index bb4d196..42952a3 100644 --- a/src/api/constant/index.ts +++ b/src/api/constant/index.ts @@ -1,6 +1,6 @@ -import axios from 'axios'; +import axios from "axios"; -const BASE_URL = 'https://api.wrapto.app/'; +const BASE_URL = "https://api.wrapto.app/"; export const BASE_INSTANCE = axios.create({ baseURL: BASE_URL, @@ -13,8 +13,8 @@ BASE_INSTANCE.interceptors.request.use( }, function err(error) { // Do something with request error - if (error.response?.data?.error === (500 || '500')) + if (error.response?.data?.error === (500 || "500")) console.error(error.response?.data?.error); return Promise.reject(error); }, -); \ No newline at end of file +); diff --git a/src/api/services/Transaction.ts b/src/api/services/Transaction.ts index 9e53608..8a704e5 100644 --- a/src/api/services/Transaction.ts +++ b/src/api/services/Transaction.ts @@ -1,12 +1,11 @@ +import { SuccessDataT } from "types/apiResult"; +import { BASE_INSTANCE } from "../constant"; +import { TransactionT } from "types/Transactions"; -import { SuccessDataT } from "types/apiResult" -import { BASE_INSTANCE } from "../constant" -import { TransactionT } from "types/Transactions" +export const searchServices = (data: string) => { + return BASE_INSTANCE.get(`/search?q=${data}`); +}; -export const searchServices = (data:string) => { - return BASE_INSTANCE.get(`/search?q=${data}`) -} - -export const getTransactions = () : Promise>=> { - return BASE_INSTANCE.get(`/transactions/recent`) -} \ No newline at end of file +export const getTransactions = (): Promise> => { + return BASE_INSTANCE.get(`/transactions/recent`); +}; diff --git a/src/assets/icons/ArrowsUpDown.tsx b/src/assets/icons/ArrowsUpDown.tsx index c94b803..df34ed2 100644 --- a/src/assets/icons/ArrowsUpDown.tsx +++ b/src/assets/icons/ArrowsUpDown.tsx @@ -1,6 +1,6 @@ -import { IconProps } from 'types/iconProps'; +import { IconProps } from "types/iconProps"; -export function ArrowsUpDown({ className }: IconProps) { +export function ArrowsUpDown({ className }: IconProps) { return ( - - - - - ); +export function BurgerIcon({ className }: IconProps) { + return ( + + + + + + ); } diff --git a/src/assets/icons/ChevronDown.tsx b/src/assets/icons/ChevronDown.tsx index e40f6c5..7a7f697 100644 --- a/src/assets/icons/ChevronDown.tsx +++ b/src/assets/icons/ChevronDown.tsx @@ -1,9 +1,9 @@ -import { IconProps } from 'types/iconProps'; +import { IconProps } from "types/iconProps"; -export function ChevronDown({ className }: IconProps) { +export function ChevronDown({ className }: IconProps) { return ( - - - ); +export function DiscordIcon({ className }: IconProps) { + return ( + + + + ); } diff --git a/src/assets/icons/GithubIcon.tsx b/src/assets/icons/GithubIcon.tsx index 50876d7..b3d1e30 100644 --- a/src/assets/icons/GithubIcon.tsx +++ b/src/assets/icons/GithubIcon.tsx @@ -1,4 +1,3 @@ - import { IconProps } from "types/iconProps"; export function GithubIcon({ className }: IconProps) { diff --git a/src/components/Home/TransferSection/TransferBoxes.tsx b/src/components/Home/TransferSection/TransferBoxes.tsx index d3e42e5..48958bb 100644 --- a/src/components/Home/TransferSection/TransferBoxes.tsx +++ b/src/components/Home/TransferSection/TransferBoxes.tsx @@ -64,7 +64,7 @@ export default function TransferBoxes({ setTransferFrom(maxContract); }; const fee = handleFee(+transferFrom); - + return ( <>
diff --git a/src/components/Home/TransferSection/abi.ts b/src/components/Home/TransferSection/abi.ts index d08271c..e911a00 100644 --- a/src/components/Home/TransferSection/abi.ts +++ b/src/components/Home/TransferSection/abi.ts @@ -1,630 +1,629 @@ -export const abi = - [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "destinationAddress", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "Bridge", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Unpaused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "FEE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "destinationAddress", - "type": "string" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "adminBridge", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "destinationAddress", - "type": "string" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "bridge", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "bridged", - "outputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "string", - "name": "destinationAddress", - "type": "string" - }, - { - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "counter", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] +export const abi = [ + { + inputs: [], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "previousAdmin", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newAdmin", + type: "address", + }, + ], + name: "AdminChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "spender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "beacon", + type: "address", + }, + ], + name: "BeaconUpgraded", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "string", + name: "destinationAddress", + type: "string", + }, + { + indexed: false, + internalType: "uint256", + name: "fee", + type: "uint256", + }, + ], + name: "Bridge", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint8", + name: "version", + type: "uint8", + }, + ], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnershipTransferred", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "Paused", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "Unpaused", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "Upgraded", + type: "event", + }, + { + inputs: [], + name: "FEE", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "string", + name: "destinationAddress", + type: "string", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "adminBridge", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "string", + name: "destinationAddress", + type: "string", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "bridge", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "bridged", + outputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "string", + name: "destinationAddress", + type: "string", + }, + { + internalType: "uint256", + name: "fee", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "counter", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "subtractedValue", + type: "uint256", + }, + ], + name: "decreaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "addedValue", + type: "uint256", + }, + ], + name: "increaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "mint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "paused", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "proxiableUUID", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newImplementation", + type: "address", + }, + ], + name: "upgradeTo", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newImplementation", + type: "address", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "upgradeToAndCall", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "withdrawFee", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; diff --git a/src/components/Home/data.json b/src/components/Home/data.json index f402b50..30abe03 100644 --- a/src/components/Home/data.json +++ b/src/components/Home/data.json @@ -1,10 +1,13 @@ { - "pactus": [{ - "title": "Pactus", - "icon": "/companies/pactus.svg", - "value": "PAC" - }], - "companies": [{ + "pactus": [ + { + "title": "Pactus", + "icon": "/companies/pactus.svg", + "value": "PAC" + } + ], + "companies": [ + { "value": "Polygon", "title": "Polygon", "icon": "/companies/polygon.svg" diff --git a/src/components/Home/style.css b/src/components/Home/style.css index 19e104a..924b2ca 100644 --- a/src/components/Home/style.css +++ b/src/components/Home/style.css @@ -1,5 +1,4 @@ .spin { - animation: ring-spin 120s linear infinite; transform: translateX(-50%); transform: translateY(-50%); @@ -15,7 +14,6 @@ } } - .arrow-scroll-down { position: absolute; left: 0%; @@ -39,11 +37,9 @@ -moz-animation: fade_move_down 2s ease-in-out infinite; animation: fade_move_down 2s ease-in-out infinite; - --x-position:-7px; - + --x-position: -7px; } - /*animated scroll arrow animation*/ @-webkit-keyframes fade_move_down { 0% { @@ -91,4 +87,4 @@ transform: translate(var(--x-position), 6px) rotate(45deg); opacity: 0; } -} \ No newline at end of file +} diff --git a/src/components/TransactionMemo/CopyButton.tsx b/src/components/TransactionMemo/CopyButton.tsx index 7340a68..f3a3029 100644 --- a/src/components/TransactionMemo/CopyButton.tsx +++ b/src/components/TransactionMemo/CopyButton.tsx @@ -32,7 +32,7 @@ export default function CopyButton({ text }: { text: string }) { Copy - +

Copied!

diff --git a/src/components/Transactions/companiesLogo.ts b/src/components/Transactions/companiesLogo.ts index 6da1c25..638bbe6 100644 --- a/src/components/Transactions/companiesLogo.ts +++ b/src/components/Transactions/companiesLogo.ts @@ -6,14 +6,13 @@ export const companiesLogo = { srcTo: "/companies/pactus.svg", chainFrom: "Polygon Network", chainTo: "Pactus Network", - explorer:networks["pac"].explorer + explorer: networks["pac"].explorer, }, PACTUS_POLYGON: { srcFrom: "/companies/pactus.svg", srcTo: "/companies/polygon.svg", chainFrom: "Pactus Network", chainTo: "Polygon Network", - explorer:networks["amoy"].explorer - + explorer: networks["amoy"].explorer, }, -}; \ No newline at end of file +}; diff --git a/src/components/shared/Checkbox.tsx b/src/components/shared/Checkbox.tsx index dd2107f..e515fe1 100644 --- a/src/components/shared/Checkbox.tsx +++ b/src/components/shared/Checkbox.tsx @@ -25,7 +25,10 @@ const Checkbox = React.forwardRef< -
diff --git a/src/components/shared/ConnectButton.tsx b/src/components/shared/ConnectButton.tsx index 34f1864..4d83660 100644 --- a/src/components/shared/ConnectButton.tsx +++ b/src/components/shared/ConnectButton.tsx @@ -41,7 +41,7 @@ export const ConnectButton = ({ // (!authenticationStatus || // authenticationStatus === "authenticated"); // if (account) setAccount && setAccount(account); - + return (
, VariantProps { diff --git a/src/components/shared/Select/index.tsx b/src/components/shared/Select/index.tsx index 413ad79..2e9782d 100644 --- a/src/components/shared/Select/index.tsx +++ b/src/components/shared/Select/index.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import * as SelectPrimitive from "@radix-ui/react-select"; -import { Check,ChevronDown, ChevronUp } from "lucide-react"; +import { Check, ChevronDown, ChevronUp } from "lucide-react"; import { cn } from "lib/utils"; import { ChevronDown as WraptoChevronDown } from "assets/icons"; diff --git a/src/components/shared/TextField.tsx b/src/components/shared/TextField.tsx index aa26746..2465acb 100644 --- a/src/components/shared/TextField.tsx +++ b/src/components/shared/TextField.tsx @@ -68,7 +68,7 @@ const TextField = React.forwardRef( const helperTextClasses = clsx( "caption font-bold text-gray-400 animate-fade-up transition-all duration-700", ); - + return (
{label && ( diff --git a/src/constants/enums/txEnums.ts b/src/constants/enums/txEnums.ts index af9667d..0df26f3 100644 --- a/src/constants/enums/txEnums.ts +++ b/src/constants/enums/txEnums.ts @@ -1,9 +1,9 @@ export enum TransactionStatus { PENDING = "PENDING", COMPLETE = "COMPLETE", - FAILED = "FAILED" + FAILED = "FAILED", } export enum BridgeType { PACTUS_POLYGON = "PACTUS_POLYGON", - POLYGON_PACTUS = "POLYGON_PACTUS" -} \ No newline at end of file + POLYGON_PACTUS = "POLYGON_PACTUS", +} diff --git a/src/index.css b/src/index.css index f78e101..16b05f5 100644 --- a/src/index.css +++ b/src/index.css @@ -35,19 +35,19 @@ html.lenis body { --primary: #ffffff; --secondary: #3ae27d; - --error: #E23A4B; - --danger: #E29F3A; + --error: #e23a4b; + --danger: #e29f3a; --background: #0c0e0e; --gray-normal: #1d1d1d; - --gray-50: #DFE3E5; + --gray-50: #dfe3e5; --gray-100: #bec7ca; --gray-200: #9eaab0; - --gray-300: #7E8E95; + --gray-300: #7e8e95; --gray-400: #627077; --gray-500: #485358; - --gray-600: #3B4448; - --gray-700: #2F373A; - --gray-800: #24292B; + --gray-600: #3b4448; + --gray-700: #2f373a; + --gray-800: #24292b; --gray-900: #181b1d; --gray-950: #0c0e0e; @@ -96,80 +96,67 @@ html.lenis body { @layer base { .display-1 { @apply text-[10.25rem] leading-[190px] -tracking-tight - /* font-size: 96px */ - ; + /* font-size: 96px */; } .display-1 { @apply text-[7.75rem] leading-[160px] -tracking-tight - /* font-size: 124px */ - ; + /* font-size: 124px */; } .heading-1 { @apply text-[6rem] leading-[130px] -tracking-tight - /* font-size: 96px */ - ; + /* font-size: 96px */; } .heading-2 { @apply text-[4rem] leading-[63px] tracking-wider - /* font-size: 64px */ - ; + /* font-size: 64px */; } .heading-3 { @apply text-[3.5rem] leading-[61px] tracking-wider - /* font-size: 56px */ - ; + /* font-size: 56px */; } .heading-4 { @apply text-[3rem] leading-[49px] tracking-wider - /* font-size: 48px */ - ; + /* font-size: 48px */; } .heading-5 { @apply text-[2.5rem] leading-[44px] tracking-wider - /* font-size: 40px */ - ; + /* font-size: 40px */; } .heading-6 { @apply text-[2rem] leading-[45px] tracking-wider - /* font-size: 40px */ - ; + /* font-size: 40px */; } .title-1 { @apply text-[1.5rem] leading-[26px] tracking-wider - /* font-size: 24px */ - ; + /* font-size: 24px */; } .title-2 { @apply text-[1.25rem] leading-[26px] tracking-wider - /* font-size: 20px */ - ; + /* font-size: 20px */; } .body-1 { @apply text-[1rem] leading-[20px] tracking-wider - /* font-size: 16px */ - ; + /* font-size: 16px */; } .body-2 { @apply text-[0.875rem] tracking-wider - /* font-size: 14px */ - ; + /* font-size: 14px */; } .caption-1 { @apply text-[0.75rem] tracking-wider - /* font-size: 14px */ - ; + /* font-size: 14px */; } h1 { @@ -201,4 +188,4 @@ input[type="search"]::-webkit-search-results-decoration { .shadow-primary { box-shadow: 0px 0px 28.6px 0px rgba(58, 226, 125, 0.46); -} \ No newline at end of file +} diff --git a/src/layout/BurgerMenu.tsx b/src/layout/BurgerMenu.tsx index 916f6ae..4bed125 100644 --- a/src/layout/BurgerMenu.tsx +++ b/src/layout/BurgerMenu.tsx @@ -14,7 +14,6 @@ import Logo from "assets/svg/logo.svg"; import { useState } from "react"; export default function BurgerMenu() { - const fullLinks = communityLinks.concat(links as CommunityLinksT[]); const [open, setOpen] = useState(false); @@ -48,7 +47,6 @@ export default function BurgerMenu() {
    - {fullLinks.map((link, key) => (
  • setOpen(false)} diff --git a/src/lib/utils.ts b/src/lib/utils.ts index c22f0d0..a120dc1 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -4,37 +4,40 @@ import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } -export const formatNumber = (num:number)=>{ - return new Intl.NumberFormat('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 6 }).format(num) -} +export const formatNumber = (num: number) => { + return new Intl.NumberFormat("en-US", { + minimumFractionDigits: 2, + maximumFractionDigits: 6, + }).format(num); +}; export function decimal(num: number): number { - return Number(num) * Number(1e9) + return Number(num) * Number(1e9); } export function unDecimal(num: number): number { - return Number(num) / Number(1e9) + return Number(num) / Number(1e9); } export const handlePaste = async () => { await navigator.clipboard.readText().then(text => { - return text - }); - }; + return text; + }); +}; export const handleCopy = (text: string) => { navigator.clipboard.writeText(text); - }; +}; - export const pactusValidator=(value:string)=>{ - return /^(pc1z|[13])[a-zA-HJ-NP-Z0-9]{25,39}$/gm.test(value) - } +export const pactusValidator = (value: string) => { + return /^(pc1z|[13])[a-zA-HJ-NP-Z0-9]{25,39}$/gm.test(value); +}; - export const polygonValidator=(value:string)=>{ - return ((/^(0x)?[0-9a-fA-F]{40}$/.test(value))) - } -export const handleFee =(value:number)=>{ - let fee: number; +export const polygonValidator = (value: string) => { + return /^(0x)?[0-9a-fA-F]{40}$/.test(value); +}; +export const handleFee = (value: number) => { + let fee: number; if (value / 200 > 5) { fee = 5; @@ -43,6 +46,5 @@ export const handleFee =(value:number)=>{ } else { fee = value / 200; } - return fee -} - + return fee; +}; diff --git a/src/main.tsx b/src/main.tsx index 03757fc..0cd37cf 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -7,12 +7,10 @@ import { BrowserRouter } from "react-router-dom"; import { darkTheme, RainbowKitProvider } from "@rainbow-me/rainbowkit"; import { WagmiProvider } from "wagmi"; - import { config } from "./wagmi/wagmi.ts"; import "./index.css"; import "@rainbow-me/rainbowkit/styles.css"; - globalThis.Buffer = Buffer; const queryClient = new QueryClient(); diff --git a/src/pages/index.ts b/src/pages/index.ts index 41cee5c..e51aeb8 100644 --- a/src/pages/index.ts +++ b/src/pages/index.ts @@ -1,5 +1,5 @@ -export * from './Home'; -export * from './SuccessTx'; -export * from './TransactionMemo'; -export * from './Transactions'; -export * from './NotFound'; \ No newline at end of file +export * from "./Home"; +export * from "./SuccessTx"; +export * from "./TransactionMemo"; +export * from "./Transactions"; +export * from "./NotFound"; diff --git a/src/types/Transactions.ts b/src/types/Transactions.ts index 7da021c..297b1a5 100644 --- a/src/types/Transactions.ts +++ b/src/types/Transactions.ts @@ -9,4 +9,4 @@ export type TransactionT = { status: string; tx_id: string; bridge_type: BridgeType; -}; \ No newline at end of file +}; diff --git a/src/types/apiResult.ts b/src/types/apiResult.ts index 4f81ae1..9c01a6f 100644 --- a/src/types/apiResult.ts +++ b/src/types/apiResult.ts @@ -1,8 +1,8 @@ export type SuccessDataT = { data: { - data: T, - message: string, - status: number - }, - status: number -} \ No newline at end of file + data: T; + message: string; + status: number; + }; + status: number; +}; diff --git a/src/types/bridgeButton.ts b/src/types/bridgeButton.ts index dc79922..c07cbe3 100644 --- a/src/types/bridgeButton.ts +++ b/src/types/bridgeButton.ts @@ -3,4 +3,4 @@ export type BridgeButtonProps = { transferTo: string | number; disabled?: boolean; network: string; -}; \ No newline at end of file +}; diff --git a/src/wagmi/networks.ts b/src/wagmi/networks.ts index 304d855..92ca2c4 100644 --- a/src/wagmi/networks.ts +++ b/src/wagmi/networks.ts @@ -1,28 +1,27 @@ - export type ContractAddressT =`0x${string}` +export type ContractAddressT = `0x${string}`; - -type NetworkT= { +type NetworkT = { name: string; contractAddress: ContractAddressT; explorer: string; rpcUrl?: string; chainId?: number; symbol?: string; -} +}; -export const networks : Record={ - amoy:{ - name: 'MATIC', - contractAddress:'0x2f77E0afAEE06970Bf860B8267b5aFECFFF6F216', - explorer:"https://polygonscan.com/tx", - rpcUrl:"https://polygon-rpc.com", - chainId:137, - symbol:"MATIC" - }, - pac:{ - name: 'PAC', - contractAddress:'0x', - explorer:"https://pacviewer.com/transaction", - symbol:"PAC" - } -} +export const networks: Record = { + amoy: { + name: "MATIC", + contractAddress: "0x2f77E0afAEE06970Bf860B8267b5aFECFFF6F216", + explorer: "https://polygonscan.com/tx", + rpcUrl: "https://polygon-rpc.com", + chainId: 137, + symbol: "MATIC", + }, + pac: { + name: "PAC", + contractAddress: "0x", + explorer: "https://pacviewer.com/transaction", + symbol: "PAC", + }, +}; diff --git a/src/wagmi/polyfills.ts b/src/wagmi/polyfills.ts index a476630..3e1ab6a 100644 --- a/src/wagmi/polyfills.ts +++ b/src/wagmi/polyfills.ts @@ -1,7 +1,7 @@ -import { Buffer } from 'buffer'; +import { Buffer } from "buffer"; window.global = window.global ?? window; window.Buffer = window.Buffer ?? Buffer; window.process = window.process ?? { env: {} }; // Minimal process polyfill -export {}; \ No newline at end of file +export {}; diff --git a/src/wagmi/wagmi.ts b/src/wagmi/wagmi.ts index 3052b22..43e2760 100644 --- a/src/wagmi/wagmi.ts +++ b/src/wagmi/wagmi.ts @@ -1,12 +1,9 @@ -import { getDefaultConfig } from '@rainbow-me/rainbowkit'; -import { polygon } from 'viem/chains'; - +import { getDefaultConfig } from "@rainbow-me/rainbowkit"; +import { polygon } from "viem/chains"; export const config = getDefaultConfig({ - appName: 'Wrapto', - projectId: '412518712bdfdffa4c475e1d23133393', - chains: [ - polygon, - ], - ssr: false, + appName: "Wrapto", + projectId: "412518712bdfdffa4c475e1d23133393", + chains: [polygon], + ssr: false, }); diff --git a/tailwind.config.js b/tailwind.config.js index 0149ef1..c77b180 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,6 +1,5 @@ -import tailwindcssAnimated from 'tailwindcss-animated'; -import tailwindcssAnimate from 'tailwindcss-animate'; - +import tailwindcssAnimated from "tailwindcss-animated"; +import tailwindcssAnimate from "tailwindcss-animate"; /** @type {import('tailwindcss').Config} */ export default { @@ -53,8 +52,8 @@ export default { 900: "var(--gray-900)", 950: "var(--gray-950)", }, - error: 'var(--error)', - danger: 'var(--danger)' + error: "var(--error)", + danger: "var(--danger)", }, }, fontFamily: { @@ -73,9 +72,7 @@ export default { plugins: [ tailwindcssAnimated, tailwindcssAnimate, - function ({ - addComponents - }) { + function ({ addComponents }) { addComponents({ ".container": { maxWidth: "100%", @@ -107,4 +104,4 @@ export default { }); }, ], -}; \ No newline at end of file +}; diff --git a/vite.config.ts b/vite.config.ts index f267e0a..fe054fa 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,6 +4,6 @@ import tsconfigPaths from "vite-tsconfig-paths"; // https://vitejs.dev/config/ export default defineConfig({ - base:'/', + base: "/", plugins: [react(), tsconfigPaths()], });