Skip to content

Commit

Permalink
run prettier, update package-lock.json
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo committed Sep 11, 2023
1 parent 3787479 commit d66a37b
Show file tree
Hide file tree
Showing 21 changed files with 218 additions and 29,605 deletions.
29,393 changes: 1 addition & 29,392 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import React from "react";

type ErrorBoundaryState = {
hasError: boolean;
}
};

export default class ErrorBoundary extends React.Component<any, ErrorBoundaryState> {
export default class ErrorBoundary extends React.Component<
any,
ErrorBoundaryState
> {
constructor(props: {} | Readonly<{}>) {
super(props);
this.state = { hasError: false };
Expand Down
2 changes: 1 addition & 1 deletion src/components/KeyAndBalance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
isEVMChain,
isTerraChain,
CHAIN_ID_SUI,
CHAIN_ID_SEI
CHAIN_ID_SEI,
} from "@certusone/wormhole-sdk";
import ConnectWalletButton from "./ConnectWalletButton";

Expand Down
5 changes: 3 additions & 2 deletions src/components/Transfer/AddToMetamask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ export default function AddToMetamask() {
THRESHOLD_TBTC_CONTRACTS[sourceChain];
const tbtcAsset = THRESHOLD_TBTC_CONTRACTS[targetChain];

const { provider, signerAddress, evmChainId, wallet } =
useEthereumProvider(targetChain as any);
const { provider, signerAddress, evmChainId, wallet } = useEthereumProvider(
targetChain as any
);
const hasCorrectEvmNetwork = evmChainId === getEvmChainId(targetChain);
const handleClick = useCallback(() => {
if (provider && targetAsset && signerAddress && hasCorrectEvmNetwork) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Transfer/RegisterNowButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
CHAIN_ID_XPLA,
hexToNativeAssetString,
CHAIN_ID_SUI,
CHAIN_ID_SEI
CHAIN_ID_SEI,
} from "@certusone/wormhole-sdk";

export function RegisterNowButtonCore({
Expand Down
2 changes: 1 addition & 1 deletion src/contexts/SeiWalletContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export const getSeiWallets = () => {

export const useSeiWallet = () => {
return useWallet<SeiWallet>(CHAIN_ID_SEI);
};
};
2 changes: 1 addition & 1 deletion src/hooks/useCheckIfWormholeWrapped.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import {
XPLA_LCD_CLIENT_CONFIG,
THRESHOLD_TBTC_CONTRACTS,
TBTC_ASSET_ADDRESS,
SEI_TRANSLATOR
SEI_TRANSLATOR,
} from "../utils/consts";
import { getOriginalAssetNear, makeNearAccount } from "../utils/near";
import { LCDClient as XplaLCDClient } from "@xpla/xpla.js";
Expand Down
16 changes: 8 additions & 8 deletions src/hooks/useFetchForeignAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,14 @@ function useFetchForeignAsset(
}
: foreignChain === CHAIN_ID_SEI
? async () => {
const client = await getSeiWasmClient();
return getForeignAssetSei(
getTokenBridgeAddressForChain(foreignChain),
client,
originChain,
hexToUint8Array(originAssetHex)
);
}
const client = await getSeiWasmClient();
return getForeignAssetSei(
getTokenBridgeAddressForChain(foreignChain),
client,
originChain,
hexToUint8Array(originAssetHex)
);
}
: foreignChain === CHAIN_ID_APTOS
? () => {
return getForeignAssetAptos(
Expand Down
5 changes: 3 additions & 2 deletions src/hooks/useGetTargetParsedTokenAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ function useGetTargetParsedTokenAccounts() {
(targetAsset && metadata.data?.get(targetAsset)?.decimals) || undefined;
const { publicKey: solPK, wallet: solanaWallet } = useSolanaWallet();
const terraWallet = useTerraWallet(targetChain as any);
const { provider, signerAddress, evmChainId } =
useEthereumProvider(targetChain as any);
const { provider, signerAddress, evmChainId } = useEthereumProvider(
targetChain as any
);
const hasCorrectEvmNetwork = evmChainId === getEvmChainId(targetChain);
const xplaWallet = useXplaWallet();
const { address: algoAccount } = useAlgorandWallet();
Expand Down
9 changes: 5 additions & 4 deletions src/hooks/useHandleAttest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ import {
SOL_BRIDGE_ADDRESS,
SOL_TOKEN_BRIDGE_ADDRESS,
WORMHOLE_RPC_HOSTS,
SEI_NATIVE_DENOM
SEI_NATIVE_DENOM,
} from "../utils/consts";
import {
attestNearFromNear,
Expand Down Expand Up @@ -671,8 +671,9 @@ export function useHandleAttest() {
const isSendComplete = useSelector(selectAttestIsSendComplete);
const { signer } = useEthereumProvider(sourceChain as any);
const { publicKey: solPK, wallet: solanaWallet } = useSolanaWallet();
const { walletAddress: terraAddress, wallet: terraWallet } =
useTerraWallet(sourceChain as any);
const { walletAddress: terraAddress, wallet: terraWallet } = useTerraWallet(
sourceChain as any
);
const terraFeeDenom = useSelector(selectTerraFeeDenom);
const xplaWallet = useXplaWallet();
const { address: algoAccount, wallet: algoWallet } = useAlgorandWallet();
Expand Down Expand Up @@ -744,7 +745,7 @@ export function useHandleAttest() {
terraAddress,
suiWallet,
seiWallet,
seiAddress
seiAddress,
]);
return useMemo(
() => ({
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useHandleCreateWrapped.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
CHAIN_ID_SUI,
parseAttestMetaVaa,
createWrappedOnSui,
CHAIN_ID_SEI
CHAIN_ID_SEI,
} from "@certusone/wormhole-sdk";

import { Alert } from "@material-ui/lab";
Expand Down Expand Up @@ -735,7 +735,7 @@ export function useHandleCreateWrapped(
seiAddress &&
!!signedVAA
) {
sei(dispatch, enqueueSnackbar, seiWallet, signedVAA, shouldUpdate);
sei(dispatch, enqueueSnackbar, seiWallet, signedVAA, shouldUpdate);
} else if (
targetChain === CHAIN_ID_APTOS &&
!!aptosAddress &&
Expand Down Expand Up @@ -815,7 +815,7 @@ export function useHandleCreateWrapped(
foreignAddress,
suiWallet,
seiWallet,
seiAddress
seiAddress,
]);
return useMemo(
() => ({
Expand Down
10 changes: 5 additions & 5 deletions src/hooks/useHandleRedeem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
CHAIN_ID_SEI,
parseVaa,
parseTokenTransferPayload,
cosmos
cosmos,
} from "@certusone/wormhole-sdk";
import { completeTransferAndRegister } from "@certusone/wormhole-sdk/lib/esm/aptos/api/tokenBridge";
import { Alert } from "@material-ui/lab";
Expand Down Expand Up @@ -66,7 +66,7 @@ import {
SOL_TOKEN_BRIDGE_ADDRESS,
getBridgeAddressForChain,
THRESHOLD_GATEWAYS,
SEI_TRANSLATOR
SEI_TRANSLATOR,
} from "../utils/consts";
import {
makeNearAccount,
Expand Down Expand Up @@ -615,7 +615,7 @@ export function useHandleRedeem() {
seiAddress &&
signedVAA
) {
sei(dispatch, enqueueSnackbar, seiWallet, signedVAA);
sei(dispatch, enqueueSnackbar, seiWallet, signedVAA);
} else if (targetChain === CHAIN_ID_APTOS && !!aptosAddress && signedVAA) {
aptos(dispatch, enqueueSnackbar, signedVAA, aptosWallet!);
} else if (
Expand Down Expand Up @@ -667,7 +667,7 @@ export function useHandleRedeem() {
aptosWallet,
algoWallet,
seiWallet,
seiAddress
seiAddress,
]);

const handleRedeemNativeClick = useCallback(() => {
Expand Down Expand Up @@ -741,7 +741,7 @@ export function useHandleRedeem() {
suiWallet,
isTBTC,
seiWallet,
seiAddress
seiAddress,
]);

const handleAcalaRelayerRedeemClick = useCallback(async () => {
Expand Down
4 changes: 1 addition & 3 deletions src/hooks/useHandleTransfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,6 @@ async function injective(
}
}


async function sei(
dispatch: any,
enqueueSnackbar: any,
Expand Down Expand Up @@ -1184,7 +1183,6 @@ export function useHandleTransfer() {
maybeAdditionalPayload,
relayerFee
);

} else if (
sourceChain === CHAIN_ID_XPLA &&
!!xplaWallet &&
Expand Down Expand Up @@ -1340,7 +1338,7 @@ export function useHandleTransfer() {
maybeAdditionalPayload,
isTBTC,
seiWallet,
seiAddress
seiAddress,
]);
return useMemo(
() => ({
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useIsWalletReady.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function useIsWalletReady(
injAddress,
suiAddress,
hasSeiWallet,
seiAddress
seiAddress,
]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ export default function useMetadata(
suiAddresses,
suiMetadata,
seiAddresses,
seiMetadata
seiMetadata,
]
);

Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useSeiMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const fetchSingleMetadata = async (address: string, client: CosmWasmClient) =>
symbol,
tokenName,
decimals,
} as SeiMetadata)
}) as SeiMetadata
);

const fetchSeiMetadata = async (
Expand Down Expand Up @@ -93,4 +93,4 @@ const useSeiMetadata = (
);
};

export default useSeiMetadata;
export default useSeiMetadata;
2 changes: 1 addition & 1 deletion src/hooks/useSeiNativeBalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ export default function useSeiNativeBalances(
}, [walletAddress, refresh]);
const value = useMemo(() => ({ isLoading, balances }), [isLoading, balances]);
return value;
}
}
2 changes: 1 addition & 1 deletion src/hooks/useSyncTargetAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ function useSyncTargetAddress(shouldFire: boolean, nft?: boolean) {
injAddress,
suiAddress,
isTBTC,
seiAddress
seiAddress,
]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
CHAIN_ID_SUI,
CHAIN_ID_TERRA2,
CHAIN_ID_XPLA,
CHAIN_ID_SEI
CHAIN_ID_SEI,
} from "@xlabs-libs/wallet-aggregator-core";
import { WalletContextProvider } from "@xlabs-libs/wallet-aggregator-react";
import { SnackbarProvider } from "notistack";
Expand Down
6 changes: 3 additions & 3 deletions src/utils/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
ensureHexPrefix,
uint8ArrayToHex,
hexToNativeAssetString,
cosmos
cosmos,
} from "@certusone/wormhole-sdk";
import { clusterApiUrl } from "@solana/web3.js";
import { getAddress } from "ethers/lib/utils";
Expand Down Expand Up @@ -187,7 +187,7 @@ export const CHAINS: ChainInfo[] =
{
id: CHAIN_ID_SEI,
name: "Sei",
logo: seiIcon
logo: seiIcon,
},
{
id: CHAIN_ID_SOLANA,
Expand Down Expand Up @@ -315,7 +315,7 @@ export const CHAINS: ChainInfo[] =
{
id: CHAIN_ID_SEI,
name: "Sei",
logo: seiIcon
logo: seiIcon,
},
{
id: CHAIN_ID_SOLANA,
Expand Down
Loading

0 comments on commit d66a37b

Please sign in to comment.