Skip to content

Commit

Permalink
update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
frontendphil committed Oct 23, 2024
1 parent 9ad3fef commit 601631a
Show file tree
Hide file tree
Showing 24 changed files with 50 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
useConfirmationModal,
} from '@/components'
import { ProviderType, Route } from '@/types'
import { useRoute, useRoutes, useSelectedRouteId } from '@/zodiac-routes'
import { KnownContracts } from '@gnosis.pm/zodiac'
import { ZeroAddress } from 'ethers'
import React, { useState } from 'react'
Expand All @@ -28,7 +29,6 @@ import {
asLegacyConnection,
fromLegacyConnection,
} from '../legacyConnectionMigrations'
import { useRoute, useRoutes, useSelectedRouteId } from '../routeHooks'
import { AvatarInput } from './AvatarInput'
import { ChainSelect } from './ChainSelect'
import { ModSelect, NO_MODULE_OPTION } from './ModSelect'
Expand All @@ -51,7 +51,7 @@ type ConnectionPatch = {

const ETH_ZERO_ADDRESS = 'eth:0x0000000000000000000000000000000000000000'

export const EditConnection = () => {
export const EditRoute = () => {
const [routes, saveRoute, removeRouteById] = useRoutes()
const { routeId } = useParams()
if (!routeId) {
Expand Down
2 changes: 1 addition & 1 deletion extension/src/panel/app-routes/edit-route/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { EditConnection } from './EditConnection'
export { EditRoute } from './EditRoute'
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { getReadOnlyProvider } from '@/providers'
import { JsonRpcError, LegacyConnection } from '@/types'
import { isSmartContractAddress, validateAddress } from '@/utils'
import { useRoute } from '@/zodiac-routes'
import { KnownContracts } from '@gnosis.pm/zodiac'
import { useEffect, useState } from 'react'
import {
Expand All @@ -9,7 +10,6 @@ import {
decodeRolesV1Error,
decodeRolesV2Error,
} from '../../utils'
import { useRoute } from '../routeHooks'
import { wrapRequest } from './wrapRequest'

export const useConnectionDryRun = (connection: LegacyConnection) => {
Expand Down
8 changes: 4 additions & 4 deletions extension/src/panel/app-routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EditConnection } from './edit-route'
import { RoutesList } from './list-routes'
import { EditRoute } from './edit-route'
import { ListRoutes } from './list-routes'
import { Transactions } from './transactions'

export const appRoutes = [
Expand All @@ -9,10 +9,10 @@ export const appRoutes = [
},
{
path: '/routes',
element: <RoutesList />,
element: <ListRoutes />,
},
{
path: '/routes/:routeId',
element: <EditConnection />,
element: <EditRoute />,
},
]
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { LegacyConnection, ProviderType, Route } from '@/types'
import { KnownContracts } from '@gnosis.pm/zodiac'
import { ZeroAddress } from 'ethers'
import {
Expand All @@ -9,7 +10,6 @@ import {
Roles,
Waypoint,
} from 'ser-kit'
import { LegacyConnection, ProviderType, Route } from '../../types'
import {
MULTISEND,
MULTISEND_CALL_ONLY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import {
useConfirmationModal,
} from '@/components'
import { Route } from '@/types'
import { useRoute, useRoutes, useSelectedRouteId } from '@/zodiac-routes'
import { formatDistanceToNow } from 'date-fns'
import { nanoid } from 'nanoid'
import React from 'react'
import { useNavigate } from 'react-router-dom'
import { useClearTransactions } from '../../state/transactionHooks'
import { asLegacyConnection } from '../legacyConnectionMigrations'
import { useRoute, useRoutes, useSelectedRouteId } from '../routeHooks'
import { ConnectedIcon } from './ConnectedIcon'
import { DisconnectedIcon } from './DisconnectedIcon'
import classes from './style.module.css'
Expand Down Expand Up @@ -143,7 +143,7 @@ const RouteItem: React.FC<RouteItemProps> = ({ onLaunch, onModify, route }) => {
)
}

export const RoutesList = () => {
export const ListRoutes = () => {
const [, selectRoute] = useSelectedRouteId()
const [routes] = useRoutes()
const navigate = useNavigate()
Expand Down
2 changes: 1 addition & 1 deletion extension/src/panel/app-routes/list-routes/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { RoutesList } from './RoutesList'
export { ListRoutes } from './ListRoutes'
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getAddress } from 'ethers'
import React, { useMemo } from 'react'
import { RiExternalLinkLine, RiFileCopyLine } from 'react-icons/ri'
import { ChainId } from 'ser-kit'
import { ContractInfo } from '../../utils/abi'
import { ContractInfo } from '../../../utils/abi'
import classes from './style.module.css'

interface Props {
Expand Down
5 changes: 2 additions & 3 deletions extension/src/panel/app-routes/transactions/Remove.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { IconButton } from '@/components'
import { ForkProvider, useProvider } from '@/providers'
import { TransactionState, useDispatch, useTransactions } from '@/state'
import React from 'react'
import { RiDeleteBinLine } from 'react-icons/ri'
import { ForkProvider } from '../providers'
import { useProvider } from '../providers/ProvideProvider'
import { TransactionState, useDispatch, useTransactions } from '../state'

import classes from './style.module.css'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { Flex, Tag } from '@/components'
import { useProvider } from '@/providers'
import { TransactionState } from '@/state'
import { Eip1193Provider, JsonRpcError, Route } from '@/types'
import { useRoute } from '@/zodiac-routes'
import { MetaTransactionData } from '@safe-global/safe-core-sdk-types'
import { toQuantity, ZeroAddress } from 'ethers'
import React, { useEffect, useState } from 'react'
Expand All @@ -9,13 +13,9 @@ import {
planExecution,
Route as SerRoute,
} from 'ser-kit'
import { Eip1193Provider, JsonRpcError, Route } from '../../types'
import { useProvider } from '../providers/ProvideProvider'
import { useRoute } from '../routes'
import { TransactionState } from '../state'
import { useApplicableTranslation } from '../transactionTranslations'
import { decodeRolesV1Error } from '../utils'
import { decodeGenericError, decodeRolesV2Error } from '../utils/decodeError'
import { useApplicableTranslation } from '../../transactionTranslations'
import { decodeRolesV1Error } from '../../utils'
import { decodeGenericError, decodeRolesV2Error } from '../../utils/decodeError'
import CopyToClipboard from './CopyToClipboard'
import { Translate } from './Translate'
import classes from './style.module.css'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Blockie, Box, ConnectionStack } from '@/components'
import { useRoute } from '@/zodiac-routes'
import React from 'react'
import { Link } from 'react-router-dom'
import { useRoute } from '../../routes'
import { asLegacyConnection } from '../../routes/legacyConnectionMigrations'
import { asLegacyConnection } from '../../legacyConnectionMigrations'
import ConnectionsIcon from './ConnectionsIcon'
import classes from './style.module.css'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Flex, Spinner, Tag } from '@/components'
import { useProvider } from '@/providers'
import { ExecutionStatus, TransactionState } from '@/state'
import React from 'react'
import { RiExternalLinkLine, RiGitBranchLine } from 'react-icons/ri'
import { useProvider } from '../providers/ProvideProvider'
import { ExecutionStatus, TransactionState } from '../state'
import classes from './style.module.css'

const SimulationStatus: React.FC<{
Expand Down
11 changes: 5 additions & 6 deletions extension/src/panel/app-routes/transactions/Submit.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import { CHAIN_NAME, EXPLORER_URL } from '@/chains'
import { Button, IconButton, RawAddress, toastClasses } from '@/components'
import { getReadOnlyProvider, useSubmitTransactions } from '@/providers'
import { useTransactions } from '@/state'
import { JsonRpcError, ProviderType } from '@/types'
import { useRoute } from '@/zodiac-routes'
import React, { useState } from 'react'
import { RiCloseLine, RiExternalLinkLine } from 'react-icons/ri'
import Modal, { Styles } from 'react-modal'
import { useNavigate } from 'react-router-dom'
import { toast } from 'react-toastify'
import { parsePrefixedAddress, PrefixedAddress } from 'ser-kit'
import { waitForMultisigExecution } from '../integrations/safe'
import { useSubmitTransactions } from '../providers/ProvideProvider'
import { getReadOnlyProvider } from '../providers/readOnlyProvider'
import { useRoute } from '../routes'
import { useTransactions } from '../state'
import { waitForMultisigExecution } from '../../integrations/safe'
import {
decodeGenericError,
decodeRolesV1Error,
decodeRolesV2Error,
} from '../utils'
} from '../../utils'
import classes from './style.module.css'

const Submit: React.FC = () => {
Expand Down
4 changes: 2 additions & 2 deletions extension/src/panel/app-routes/transactions/Transactions.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Button, IconButton } from '@/components'
import { ForkProvider, useProvider } from '@/providers'
import { useDispatch, useTransactions } from '@/state'
import { useRoute } from '@/zodiac-routes'
import { useEffect, useRef, useState } from 'react'
import { RiFileCopy2Line, RiRefreshLine } from 'react-icons/ri'
import { toast } from 'react-toastify'
import { useRoute } from '../routes'
import { useDispatch, useTransactions } from '../state'
import { RouteBubble } from './RouteBubble'
import Submit from './Submit'
import { Transaction } from './Transaction'
Expand Down
7 changes: 3 additions & 4 deletions extension/src/panel/app-routes/transactions/Translate.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { IconButton } from '@/components'
import { ForkProvider, useProvider } from '@/providers'
import { TransactionState, useDispatch, useTransactions } from '@/state'
import React from 'react'
import { BiWrench } from 'react-icons/bi'
import { ForkProvider } from '../providers'
import { useProvider } from '../providers/ProvideProvider'
import { TransactionState, useDispatch, useTransactions } from '../state'
import { useApplicableTranslation } from '../transactionTranslations'
import { useApplicableTranslation } from '../../transactionTranslations'

import classes from './style.module.css'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TransactionState } from '@/state'
import { Interface } from 'ethers'
import { useMemo } from 'react'
import { TransactionState } from '../state'

export const useDecodedFunctionData = (transactionState: TransactionState) => {
const { contractInfo, transaction } = transactionState
Expand Down
2 changes: 1 addition & 1 deletion extension/src/panel/integrations/safe/useSafeDelegates.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { validateAddress } from '@/utils'
import { useRoute } from '@/zodiac-routes'
import { useEffect, useState } from 'react'
import { ChainId } from 'ser-kit'
import { useRoute } from '../../routes'
import { initSafeApiKit } from './kits'

export const useSafeDelegates = (
Expand Down
2 changes: 1 addition & 1 deletion extension/src/panel/integrations/safe/useSafesWithOwner.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { validateAddress } from '@/utils'
import { useRoute } from '@/zodiac-routes'
import { useEffect, useState } from 'react'
import { ChainId } from 'ser-kit'
import { useRoute } from '../../routes'
import { initSafeApiKit } from './kits'

export const useSafesWithOwner = (
Expand Down
4 changes: 2 additions & 2 deletions extension/src/panel/integrations/zodiac/useZodiacModules.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { getReadOnlyProvider } from '@/providers'
import { validateAddress } from '@/utils'
import { useRoute } from '@/zodiac-routes'
import {
ContractAbis,
ContractAddresses,
Expand All @@ -9,8 +11,6 @@ import { Contract, id, Interface } from 'ethers'
import detectProxyTarget from 'evm-proxy-detection'
import { useEffect, useState } from 'react'
import { ChainId } from 'ser-kit'
import { getReadOnlyProvider } from '../../providers/readOnlyProvider'
import { useRoute } from '../../routes/routeHooks'
import { SupportedModuleType } from './types'

const SUPPORTED_MODULES = [
Expand Down
2 changes: 1 addition & 1 deletion extension/src/panel/providers/ProvideProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Eip1193Provider } from '@/types'
import { useRoute } from '@/zodiac-routes'
import { MetaTransactionData } from '@safe-global/safe-core-sdk-types'
import { AbiCoder, BrowserProvider, id, TransactionReceipt } from 'ethers'
import {
Expand All @@ -18,7 +19,6 @@ import {
planExecution,
Route as SerRoute,
} from 'ser-kit'
import { useRoute } from '../routes'
import { ExecutionStatus, useDispatch, useTransactions } from '../state'
import { fetchContractInfo } from '../utils/abi'
import { ForkProvider } from './ForkProvider'
Expand Down
6 changes: 5 additions & 1 deletion extension/src/panel/providers/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
export { ForkProvider } from './ForkProvider'
export { isConnected } from './isConnected'
export { ProvideProvider, useProvider } from './ProvideProvider'
export {
ProvideProvider,
useProvider,
useSubmitTransactions,
} from './ProvideProvider'
export {
getEip1193ReadOnlyProvider,
getReadOnlyProvider,
Expand Down
6 changes: 2 additions & 4 deletions extension/src/panel/transactionTranslations/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { useRoute } from '@/zodiac-routes'
import { MetaTransactionData } from '@safe-global/safe-core-sdk-types'
import { useEffect, useState } from 'react'
import { ChainId } from 'ser-kit'

import { useRoute } from '../routes'

import { MetaTransactionData } from '@safe-global/safe-core-sdk-types'
import cowswapSetPreSignature from './cowswapSetPreSignature'
import { TransactionTranslation } from './types'
import uniswapMulticall from './uniswapMulticall'
Expand Down
1 change: 1 addition & 0 deletions extension/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@/types": ["./src/types.ts"],
"@/chains": ["./src/chains/index.ts"],
"@/zodiac-routes": ["./src/panel/zodiac-routes/index.ts"],
"@/state": ["./src/panel/state/index.ts"],
"@/providers": ["./src/panel/providers/index.ts"],
"@/e2e-utils": ["./e2e/utils/index.ts"]
}
Expand Down

0 comments on commit 601631a

Please sign in to comment.