diff --git a/.prettierrc b/.prettierrc index cc8d72b8..8c3ce6d9 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,5 @@ { "singleQuote": true, - "trailingComma": "none", + "trailingComma": "all", "tabWidth": 4 } \ No newline at end of file diff --git a/apps/sample-react-app/hardhat.config.ts b/apps/sample-react-app/hardhat.config.ts index 1208d13b..9eac3ffc 100644 --- a/apps/sample-react-app/hardhat.config.ts +++ b/apps/sample-react-app/hardhat.config.ts @@ -4,8 +4,8 @@ import '@nomicfoundation/hardhat-toolbox'; const config: HardhatUserConfig = { solidity: '0.8.19', typechain: { - outDir: 'src/hardhat' - } + outDir: 'src/hardhat', + }, }; export default config; diff --git a/apps/sample-react-app/src/App.tsx b/apps/sample-react-app/src/App.tsx index 5771e94b..ec4e7372 100644 --- a/apps/sample-react-app/src/App.tsx +++ b/apps/sample-react-app/src/App.tsx @@ -11,7 +11,7 @@ import { Fonts, theme } from './Styles'; const nodeOptions: Omit = { node: 'https://testnet.vechain.org/', - network: 'test' + network: 'test', }; const walletConnectOptions: WalletConnectOptions = { @@ -20,8 +20,8 @@ const walletConnectOptions: WalletConnectOptions = { name: 'Sample VeChain dApp', description: 'A sample VeChain dApp', url: window.location.origin, - icons: [`${window.location.origin}/images/logo/my-dapp.png`] - } + icons: [`${window.location.origin}/images/logo/my-dapp.png`], + }, }; export const App = (): JSX.Element => { diff --git a/apps/sample-react-app/src/Components/AccountDetailBody.tsx b/apps/sample-react-app/src/Components/AccountDetailBody.tsx index b3721bda..b97b5708 100644 --- a/apps/sample-react-app/src/Components/AccountDetailBody.tsx +++ b/apps/sample-react-app/src/Components/AccountDetailBody.tsx @@ -13,7 +13,7 @@ interface AccountDetailBodyProps { export const AccountDetailBody: React.FC = ({ accountAddress, source, - disconnectWallet + disconnectWallet, }) => { const sourceInfo = useMemo(() => WalletSources[source], [source]); diff --git a/apps/sample-react-app/src/Components/AccountDetailModal.tsx b/apps/sample-react-app/src/Components/AccountDetailModal.tsx index 0af149ca..91a7bc27 100644 --- a/apps/sample-react-app/src/Components/AccountDetailModal.tsx +++ b/apps/sample-react-app/src/Components/AccountDetailModal.tsx @@ -17,7 +17,7 @@ export const AccountDetailModal: React.FC = ({ isOpen, onClose, address, - source + source, }) => { const { disconnect } = useWallet(); diff --git a/apps/sample-react-app/src/Components/AddressButton.tsx b/apps/sample-react-app/src/Components/AddressButton.tsx index f0632a50..1bb4bdee 100644 --- a/apps/sample-react-app/src/Components/AddressButton.tsx +++ b/apps/sample-react-app/src/Components/AddressButton.tsx @@ -27,7 +27,7 @@ export const AddressButton: React.FC = ({ if (onClick) onClick(e); if (showCopyIcon) onCopy(); }, - [onClick, showCopyIcon, onCopy] + [onClick, showCopyIcon, onCopy], ); useEffect(() => { diff --git a/apps/sample-react-app/src/Components/ConnectWalletButton.tsx b/apps/sample-react-app/src/Components/ConnectWalletButton.tsx index 469bbae4..589abab8 100644 --- a/apps/sample-react-app/src/Components/ConnectWalletButton.tsx +++ b/apps/sample-react-app/src/Components/ConnectWalletButton.tsx @@ -12,12 +12,12 @@ interface ConnectWalletButtonProps { } export const ConnectWalletButton: React.FC = ({ - buttonProps + buttonProps, }): React.ReactElement => { const { isOpen, onOpen, onClose } = useDisclosure(); const { - accountState: { address, source } + accountState: { address, source }, } = useWallet(); if (address && source) diff --git a/apps/sample-react-app/src/Components/ConnectWalletModal.tsx b/apps/sample-react-app/src/Components/ConnectWalletModal.tsx index a9e21066..fd0030d4 100644 --- a/apps/sample-react-app/src/Components/ConnectWalletModal.tsx +++ b/apps/sample-react-app/src/Components/ConnectWalletModal.tsx @@ -9,7 +9,7 @@ import { Spinner, Text, useToast, - VStack + VStack, } from '@chakra-ui/react'; import { LinkIcon, WalletIcon } from '@heroicons/react/24/solid'; import React, { useCallback, useState } from 'react'; @@ -25,7 +25,7 @@ interface ConnectedWalletDialogProps { export const ConnectWalletModal: React.FC = ({ isOpen, - onClose + onClose, }) => { const header = ( @@ -49,7 +49,7 @@ interface ConnectedWalletBodyProps { } const ConnectedWalletBody: React.FC = ({ - onClose + onClose, }) => { const toast = useToast(); const { setAccount } = useWallet(); @@ -64,8 +64,8 @@ const ConnectedWalletBody: React.FC = ({ purpose: 'identification', payload: { type: 'text', - content: 'Sign a certificate to prove your identity' - } + content: 'Sign a certificate to prove your identity', + }, }; const certResponse = await vendor.sign('cert', message).request(); @@ -76,7 +76,7 @@ const ConnectedWalletBody: React.FC = ({ domain: certResponse.annex.domain, timestamp: certResponse.annex.timestamp, signer: certResponse.annex.signer, - signature: certResponse.signature + signature: certResponse.signature, }; Certificate.verify(cert); @@ -94,10 +94,10 @@ const ConnectedWalletBody: React.FC = ({ status: 'success', position: 'bottom-left', duration: 5000, - isClosable: true + isClosable: true, }); }, - [toast, setAccount, onClose] + [toast, setAccount, onClose], ); const connectHandler = useCallback(async () => { @@ -121,7 +121,7 @@ const ConnectedWalletBody: React.FC = ({ onSuccessfullConnection, setConnectionError, setConnectionLoading, - connectToWalletHandler + connectToWalletHandler, ]); const connect = useCallback(() => { diff --git a/apps/sample-react-app/src/Components/WalletSourceRadio.tsx b/apps/sample-react-app/src/Components/WalletSourceRadio.tsx index 54de45de..823f930b 100644 --- a/apps/sample-react-app/src/Components/WalletSourceRadio.tsx +++ b/apps/sample-react-app/src/Components/WalletSourceRadio.tsx @@ -6,7 +6,7 @@ import { Image, Text, Tooltip, - VStack + VStack, } from '@chakra-ui/react'; import { ExclamationTriangleIcon } from '@heroicons/react/24/solid'; import React, { useCallback } from 'react'; @@ -24,7 +24,7 @@ export const WalletSourceRadio: React.FC = () => { setSource(source); } }, - [setSource] + [setSource], ); return ( @@ -58,7 +58,7 @@ const WalletSourceButton: React.FC = ({ source, isSelected, isDisabled, - onClick + onClick, }) => { const sourceInfo = WalletSources[source]; return ( @@ -93,7 +93,7 @@ interface SourceNotDetectedIconProps { } const SourceNotDetectedIcon: React.FC = ({ - source + source, }) => { const sourceInfo = WalletSources[source]; diff --git a/apps/sample-react-app/src/Components/layout/NavBar.tsx b/apps/sample-react-app/src/Components/layout/NavBar.tsx index 678e15cb..8076e345 100644 --- a/apps/sample-react-app/src/Components/layout/NavBar.tsx +++ b/apps/sample-react-app/src/Components/layout/NavBar.tsx @@ -12,7 +12,7 @@ import { useColorModeValue, useDisclosure, useMediaQuery, - VStack + VStack, } from '@chakra-ui/react'; import type { JSX } from 'react'; import React from 'react'; @@ -82,7 +82,7 @@ interface MobileNavBarDrawerProps { const MobileNavBarDrawer = ({ isOpen, - onClose + onClose, }: MobileNavBarDrawerProps): JSX.Element => { const { accountState, disconnect } = useWallet(); diff --git a/apps/sample-react-app/src/Components/layout/StyledContainer.tsx b/apps/sample-react-app/src/Components/layout/StyledContainer.tsx index f0f98395..5cb3b349 100644 --- a/apps/sample-react-app/src/Components/layout/StyledContainer.tsx +++ b/apps/sample-react-app/src/Components/layout/StyledContainer.tsx @@ -6,7 +6,7 @@ interface StyledContainerProps { } export const StyledContainer: React.FC = ({ - children + children, }) => { const bodyBg = useColorModeValue('gray.50', 'gray.900'); diff --git a/apps/sample-react-app/src/Components/shared/Dialog.tsx b/apps/sample-react-app/src/Components/shared/Dialog.tsx index 3301dcde..e1fb5abf 100644 --- a/apps/sample-react-app/src/Components/shared/Dialog.tsx +++ b/apps/sample-react-app/src/Components/shared/Dialog.tsx @@ -6,7 +6,7 @@ import { ModalContent, ModalFooter, ModalHeader, - ModalOverlay + ModalOverlay, } from '@chakra-ui/react'; import React from 'react'; @@ -29,7 +29,7 @@ export const Dialog: React.FC = ({ body, footer, showCloseButton = true, - closeButtonStyle = {} + closeButtonStyle = {}, }) => { return ( diff --git a/apps/sample-react-app/src/Constants/Constants.ts b/apps/sample-react-app/src/Constants/Constants.ts index 19cb0bed..7d0190c3 100644 --- a/apps/sample-react-app/src/Constants/Constants.ts +++ b/apps/sample-react-app/src/Constants/Constants.ts @@ -13,18 +13,18 @@ const baseLogoUrl = `${process.env.PUBLIC_URL}/images/logo`; export const WalletSources: Record = { [WalletSource.WalletConnect]: { name: 'Wallet Connect', - logo: `${baseLogoUrl}/wallet-connect-logo.png` + logo: `${baseLogoUrl}/wallet-connect-logo.png`, }, [WalletSource.VeWorldExtension]: { name: 'VeWorld Extension', - logo: `${baseLogoUrl}/veworld_black.png` + logo: `${baseLogoUrl}/veworld_black.png`, }, [WalletSource.Sync]: { name: 'Sync', - logo: `${baseLogoUrl}/sync.png` + logo: `${baseLogoUrl}/sync.png`, }, [WalletSource.Sync2]: { name: 'Sync 2', - logo: `${baseLogoUrl}/sync2.png` - } + logo: `${baseLogoUrl}/sync2.png`, + }, }; diff --git a/apps/sample-react-app/src/Hooks/useCounter.ts b/apps/sample-react-app/src/Hooks/useCounter.ts index 7dacfd80..30963155 100644 --- a/apps/sample-react-app/src/Hooks/useCounter.ts +++ b/apps/sample-react-app/src/Hooks/useCounter.ts @@ -9,11 +9,11 @@ const _counter: abi.Function.Definition = { { internalType: 'uint256', name: 'count', - type: 'uint256' - } + type: 'uint256', + }, ], stateMutability: 'view', - type: 'function' + type: 'function', }; const _increment: abi.Function.Definition = { @@ -21,7 +21,7 @@ const _increment: abi.Function.Definition = { name: 'increment', outputs: [], stateMutability: 'nonpayable', - type: 'function' + type: 'function', }; type IncrementStatus = 'idle' | 'in-wallet' | 'pending' | 'error'; @@ -41,7 +41,7 @@ export const useCounter = (): UseCounter => { const contract = useMemo( () => thor.account('0x8384738c995d49c5b692560ae688fc8b51af1059'), - [thor] + [thor], ); const setValue = useCallback(async () => { diff --git a/apps/sample-react-app/src/Screens/components/Counter.tsx b/apps/sample-react-app/src/Screens/components/Counter.tsx index 19c3d0a5..a269a039 100644 --- a/apps/sample-react-app/src/Screens/components/Counter.tsx +++ b/apps/sample-react-app/src/Screens/components/Counter.tsx @@ -7,7 +7,7 @@ import { Icon, Text, useToast, - VStack + VStack, } from '@chakra-ui/react'; import type { JSX } from 'react'; import React, { useCallback, useMemo } from 'react'; @@ -29,7 +29,7 @@ export const Counter = (): JSX.Element => { title: 'Counter incremented', status: 'success', duration: 2000, - isClosable: true + isClosable: true, }); }) // eslint-disable-next-line no-console diff --git a/apps/sample-react-app/src/Styles/Theme.tsx b/apps/sample-react-app/src/Styles/Theme.tsx index caeced90..c9c48168 100644 --- a/apps/sample-react-app/src/Styles/Theme.tsx +++ b/apps/sample-react-app/src/Styles/Theme.tsx @@ -3,6 +3,6 @@ import { extendTheme } from '@chakra-ui/react'; export const theme = extendTheme({ fonts: { heading: `'JetBrains Mono', sans-serif`, - body: `'Inter', sans-serif` - } + body: `'Inter', sans-serif`, + }, }); diff --git a/apps/sample-react-app/src/Utils/AccountUtils.ts b/apps/sample-react-app/src/Utils/AccountUtils.ts index 0526249f..6376deef 100644 --- a/apps/sample-react-app/src/Utils/AccountUtils.ts +++ b/apps/sample-react-app/src/Utils/AccountUtils.ts @@ -12,7 +12,7 @@ export const getPicassoImgSrc = (address: string, base64 = false): string => { export const friendlyAddress = ( address: string, lengthBefore = 6, - lengthAfter = 4 + lengthAfter = 4, ): string => { const before = address.substring(0, lengthBefore); const after = address.substring(address.length - lengthAfter); diff --git a/apps/sample-react-app/src/index.tsx b/apps/sample-react-app/src/index.tsx index 4c3a1658..e094935d 100644 --- a/apps/sample-react-app/src/index.tsx +++ b/apps/sample-react-app/src/index.tsx @@ -13,7 +13,7 @@ if (rootElement) { root.render( - + , ); } diff --git a/packages/react-wallet-kit/src/AccountReducer.ts b/packages/react-wallet-kit/src/AccountReducer.ts index 54f75dd5..f19c40b1 100644 --- a/packages/react-wallet-kit/src/AccountReducer.ts +++ b/packages/react-wallet-kit/src/AccountReducer.ts @@ -14,12 +14,12 @@ export type AccountAction = export const defaultAccountState: AccountState = { address: localStorage.getItem(ACCOUNT_KEY), - source: localStorage.getItem(WALLET_SOURCE_KEY) as WalletSource + source: localStorage.getItem(WALLET_SOURCE_KEY) as WalletSource, }; export const accountReducer = ( state: AccountState, - action: AccountAction + action: AccountAction, ): AccountState => { switch (action.type) { case 'set-address': { diff --git a/packages/react-wallet-kit/src/ConnexProvider.tsx b/packages/react-wallet-kit/src/ConnexProvider.tsx index aa2e563e..4e29ec79 100644 --- a/packages/react-wallet-kit/src/ConnexProvider.tsx +++ b/packages/react-wallet-kit/src/ConnexProvider.tsx @@ -5,7 +5,7 @@ import React, { useEffect, useMemo, useReducer, - useRef + useRef, } from 'react'; import { Connex } from '@vechain/connex'; import { newVendor } from '@vechain/connex-framework'; @@ -13,7 +13,7 @@ import type { WalletConnectOptions, WCSigner } from '@vechain/wallet-connect'; import { newWcClient, newWcSigner, - newWeb3Modal + newWeb3Modal, } from '@vechain/wallet-connect'; import { WalletSource } from '@vechain/wallet-kit'; import { accountReducer, defaultAccountState } from './AccountReducer'; @@ -21,7 +21,7 @@ import type { ConnexContext, ConnexProviderOptions, SetAccount, - SetSource + SetSource, } from './types'; /** @@ -33,11 +33,11 @@ export const ConnexProvider: React.FC = ({ children, nodeOptions, walletConnectOptions, - persistState = false + persistState = false, }): React.ReactElement => { const [accountState, dispatch] = useReducer( accountReducer, - defaultAccountState + defaultAccountState, ); const wcSignerRef = useRef(); @@ -112,15 +112,15 @@ export const ConnexProvider: React.FC = ({ dispatch({ type: 'set-wallet-source', - payload: { source: wallet, persist: persistState } + payload: { source: wallet, persist: persistState }, }); }, - [walletConnectOptions, persistState] + [walletConnectOptions, persistState], ); const thor: Connex.Thor = useMemo( () => new Connex.Thor(nodeOptions), - [nodeOptions] + [nodeOptions], ); const createWalletConnectVendor = useCallback( @@ -129,7 +129,7 @@ export const ConnexProvider: React.FC = ({ const wcClient = newWcClient({ projectId, - metadata + metadata, }); const web3Modal = newWeb3Modal(projectId); @@ -138,14 +138,14 @@ export const ConnexProvider: React.FC = ({ genesisId: thor.genesis.id, wcClient, web3Modal, - onDisconnected + onDisconnected, }); wcSignerRef.current = wcSigner; return newVendor(wcSigner); }, - [onDisconnected, thor.genesis.id] + [onDisconnected, thor.genesis.id], ); /** @@ -168,7 +168,7 @@ export const ConnexProvider: React.FC = ({ if (source === WalletSource.VeWorldExtension && window.vechain) { const extensionSigner = window.vechain.newConnexSigner( - thor.genesis.id + thor.genesis.id, ); return newVendor(extensionSigner); @@ -193,17 +193,17 @@ export const ConnexProvider: React.FC = ({ createWalletConnectVendor, thor.genesis.id, walletConnectOptions, - accountState + accountState, ]); const updateAccount: SetAccount = useCallback( (address: string) => { dispatch({ type: 'set-address', - payload: { address, persist: persistState } + payload: { address, persist: persistState }, }); }, - [persistState] + [persistState], ); const wallets: WalletSource[] = useMemo(() => { @@ -214,7 +214,7 @@ export const ConnexProvider: React.FC = ({ return { connex: { thor, - vendor + vendor, }, wallet: { setSource: updateSource, @@ -222,8 +222,8 @@ export const ConnexProvider: React.FC = ({ availableWallets, wallets, accountState, - disconnect: onDisconnected - } + disconnect: onDisconnected, + }, }; }, [ onDisconnected, @@ -233,7 +233,7 @@ export const ConnexProvider: React.FC = ({ vendor, updateSource, wallets, - availableWallets + availableWallets, ]); return {children}; diff --git a/packages/wallet-connect/src/client.ts b/packages/wallet-connect/src/client.ts index 16b053b8..269884f8 100644 --- a/packages/wallet-connect/src/client.ts +++ b/packages/wallet-connect/src/client.ts @@ -2,14 +2,14 @@ import { SignClient } from '@walletconnect/sign-client'; import type { ResolvedSignClient, WalletConnectOptions, - WCClient + WCClient, } from './types'; const _cachedClients: Record = {}; export const newWcClient = ({ projectId, - metadata + metadata, }: WalletConnectOptions): WCClient => { const cachedClient = _cachedClients[projectId]; @@ -19,7 +19,7 @@ export const newWcClient = ({ const _signClient = SignClient.init({ projectId, - metadata + metadata, }); const client: WCClient = { @@ -28,10 +28,10 @@ export const newWcClient = ({ return await _signClient; } catch (e) { throw new Error( - `Failed to initialise the wallet connect sign client` + `Failed to initialise the wallet connect sign client`, ); } - } + }, }; _cachedClients[projectId] = client; diff --git a/packages/wallet-connect/src/constants.ts b/packages/wallet-connect/src/constants.ts index fc70546d..6208a04e 100644 --- a/packages/wallet-connect/src/constants.ts +++ b/packages/wallet-connect/src/constants.ts @@ -1,6 +1,6 @@ export enum DefaultMethods { RequestTransaction = 'thor_sendTransaction', - SignCertificate = 'thor_signCertificate' + SignCertificate = 'thor_signCertificate', } export enum DefaultEvents {} diff --git a/packages/wallet-connect/src/index.ts b/packages/wallet-connect/src/index.ts index ae707d36..7f010b93 100644 --- a/packages/wallet-connect/src/index.ts +++ b/packages/wallet-connect/src/index.ts @@ -7,7 +7,7 @@ export type { WCSignerOptions, WalletConnectOptions, ResolvedSignClient, - WCClient + WCClient, } from './types'; export { newWcSigner, newWeb3Modal, newWcClient }; diff --git a/packages/wallet-connect/src/signer.ts b/packages/wallet-connect/src/signer.ts index c24c39ee..7c4932f7 100644 --- a/packages/wallet-connect/src/signer.ts +++ b/packages/wallet-connect/src/signer.ts @@ -17,7 +17,7 @@ export const newWcSigner = ({ genesisId, wcClient, web3Modal, - onDisconnected + onDisconnected, }: WCSignerOptions): WCSigner => { const chainId = `vechain:${genesisId.slice(-32)}`; let session: SessionTypes.Struct | undefined; @@ -30,13 +30,13 @@ export const newWcSigner = ({ }) .catch(() => { throw new Error( - `Failed to initialise the wallet connect sign client` + `Failed to initialise the wallet connect sign client`, ); }); const makeRequest = async ( params: EngineTypes.RequestParams['request'], - signer?: string + signer?: string, ): Promise => { const sessionTopic = await getSessionTopic(signer); @@ -45,27 +45,27 @@ export const newWcSigner = ({ return signClient.request({ topic: sessionTopic, chainId, - request: params + request: params, }); }; const signTx = async ( message: Connex.Vendor.TxMessage, - options: Connex.Signer.TxOptions + options: Connex.Signer.TxOptions, ): Promise => { return makeRequest({ method: DefaultMethods.RequestTransaction, - params: [{ message, options }] + params: [{ message, options }], }); }; const signCert = async ( message: Connex.Vendor.CertMessage, - options: Connex.Signer.CertOptions + options: Connex.Signer.CertOptions, ): Promise => { return makeRequest({ method: DefaultMethods.SignCertificate, - params: [{ message, options }] + params: [{ message, options }], }); }; @@ -80,7 +80,7 @@ export const newWcSigner = ({ try { await signClient.disconnect({ topic, - reason: getSdkError('USER_DISCONNECTED') + reason: getSdkError('USER_DISCONNECTED'), }); } catch (e) { throw new Error(`SignClient.disconnect failed`); @@ -92,7 +92,7 @@ export const newWcSigner = ({ * @param requestedAddress - The optional requested account address */ const validateSession = ( - requestedAddress?: string + requestedAddress?: string, ): SessionAccount | undefined => { if (!session) return; @@ -114,12 +114,12 @@ export const newWcSigner = ({ return { address, networkIdentifier, - topic: session.topic + topic: session.topic, }; }; const getSessionTopic = async ( - requestedAccount?: string + requestedAccount?: string, ): Promise => { const validation = validateSession(requestedAccount); @@ -136,7 +136,7 @@ export const newWcSigner = ({ const namespace: ProposalTypes.RequiredNamespace = { methods: Object.values(DefaultMethods), chains: [chainId], - events: Object.values(DefaultEvents) + events: Object.values(DefaultEvents), }; try { @@ -144,11 +144,11 @@ export const newWcSigner = ({ string, ProposalTypes.RequiredNamespace > = { - vechain: namespace + vechain: namespace, }; const { uri, approval } = await signClient.connect({ - requiredNamespaces + requiredNamespaces, }); if (uri) { @@ -211,6 +211,6 @@ export const newWcSigner = ({ signTx, signCert, disconnect, - genesisId + genesisId, }; }; diff --git a/packages/wallet-connect/src/web3-modal.ts b/packages/wallet-connect/src/web3-modal.ts index 1f5f571d..4f9072f9 100644 --- a/packages/wallet-connect/src/web3-modal.ts +++ b/packages/wallet-connect/src/web3-modal.ts @@ -22,16 +22,16 @@ export const newWeb3Modal = (projectId: string): WalletConnectModal => { id: 'veworld-mobile', links: { native: 'veworld://org.vechain.veworld.app/', - universal: 'https://veworld.com' - } - } + universal: 'https://veworld.com', + }, + }, ], themeVariables: { - '--wcm-z-index': '99999999' + '--wcm-z-index': '99999999', }, walletImages: { - 'veworld-mobile': 'https://www.veworld.net/assets/logo/logo.svg' - } + 'veworld-mobile': 'https://www.veworld.net/assets/logo/logo.svg', + }, }); _cachedModals[projectId] = modal; diff --git a/packages/wallet-kit/src/connex.ts b/packages/wallet-kit/src/connex.ts index 13717cf2..ceebdd12 100644 --- a/packages/wallet-kit/src/connex.ts +++ b/packages/wallet-kit/src/connex.ts @@ -39,12 +39,12 @@ const createConnexInstance = (options: ConnexOptions): Connex => { source: options.source, genesis: options.genesis, options: options.options, - onDisconnected: options.onDisconnected + onDisconnected: options.onDisconnected, }); } else { signer = createSigner({ source: options.source, - genesis: options.genesis + genesis: options.genesis, }); } @@ -60,7 +60,7 @@ const createConnexInstance = (options: ConnexOptions): Connex => { return { thor: framework.thor, - vendor: framework.vendor + vendor: framework.vendor, }; }; diff --git a/packages/wallet-kit/src/signer.ts b/packages/wallet-kit/src/signer.ts index 42a19854..90f29deb 100644 --- a/packages/wallet-kit/src/signer.ts +++ b/packages/wallet-kit/src/signer.ts @@ -1,11 +1,11 @@ import type { WalletConnectOptions, - WCSigner + WCSigner, } from '@vechain/wallet-connect/dist'; import { newWcClient, newWcSigner, - newWeb3Modal + newWeb3Modal, } from '@vechain/wallet-connect/dist'; import type { Connex } from '@vechain/connex'; import { createSync, createSync2 } from '@vechain/connex/esm/signer'; @@ -52,7 +52,7 @@ export const createSigner = (params: ICreateVendor): Promise => { const wcClient = newWcClient({ projectId, - metadata + metadata, }); const web3Modal = newWeb3Modal(projectId); @@ -61,7 +61,7 @@ export const createSigner = (params: ICreateVendor): Promise => { genesisId, wcClient, web3Modal, - onDisconnected + onDisconnected, }); return Promise.resolve(wcSigner); diff --git a/packages/wallet-kit/src/thor-driver.ts b/packages/wallet-kit/src/thor-driver.ts index 258f48af..f36068f8 100644 --- a/packages/wallet-kit/src/thor-driver.ts +++ b/packages/wallet-kit/src/thor-driver.ts @@ -7,7 +7,7 @@ let previousDriver: DriverNoVendor | undefined; const createDriverNoVendor = ( nodeUrl: string, - genesis: Genesis + genesis: Genesis, ): DriverNoVendor => { const genesisBlock = normalizeGenesisBlock(genesis); diff --git a/packages/wallet-kit/src/vendor-driver.ts b/packages/wallet-kit/src/vendor-driver.ts index c02fb198..6b1b52d3 100644 --- a/packages/wallet-kit/src/vendor-driver.ts +++ b/packages/wallet-kit/src/vendor-driver.ts @@ -5,7 +5,7 @@ const _cachedDrivers: Record = {}; const createVendorDriver = ( signer: Promise, - source: WalletSource + source: WalletSource, ): LazyDriver => { const cachedDriver = _cachedDrivers[source]; diff --git a/packages/wallet-kit/src/wallet.ts b/packages/wallet-kit/src/wallet.ts index 05c1405d..171b8bab 100644 --- a/packages/wallet-kit/src/wallet.ts +++ b/packages/wallet-kit/src/wallet.ts @@ -6,7 +6,7 @@ enum WalletSource { WalletConnect = 'wallet-connect', VeWorldExtension = 'veworld-extension', Sync2 = 'sync2', - Sync = 'sync' + Sync = 'sync', } interface WalletConfig { @@ -14,16 +14,16 @@ interface WalletConfig { } const DEFAULT_CONFIG: WalletConfig = { - requiresCertificate: true + requiresCertificate: true, }; const WalletMapping: Record = { [WalletSource.WalletConnect]: { - requiresCertificate: false + requiresCertificate: false, }, [WalletSource.VeWorldExtension]: DEFAULT_CONFIG, [WalletSource.Sync2]: DEFAULT_CONFIG, - [WalletSource.Sync]: DEFAULT_CONFIG + [WalletSource.Sync]: DEFAULT_CONFIG, }; export { WalletSource, WalletMapping };