Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: natively support clear signing with Ledger #4416

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"@emotion/server": "^11.11.0",
"@emotion/styled": "^11.11.0",
"@gnosis.pm/zodiac": "^4.0.3",
"@ledgerhq/context-module": "^1.0.0",
"@ledgerhq/device-management-kit": "^0.4.0",
"@ledgerhq/device-signer-kit-ethereum": "^1.0.0",
"@mui/icons-material": "^5.14.20",
"@mui/material": "^5.16.7",
"@mui/x-date-pickers": "^5.0.20",
Expand All @@ -69,7 +72,6 @@
"@web3-onboard/core": "^2.21.4",
"@web3-onboard/injected-wallets": "^2.11.2",
"@web3-onboard/keystone": "^2.3.7",
"@web3-onboard/ledger": "2.3.2",
"@web3-onboard/trezor": "^2.4.2",
"@web3-onboard/walletconnect": "^2.5.4",
"blo": "^1.1.1",
Expand Down
5 changes: 4 additions & 1 deletion src/components/safe-apps/AppFrame/useAppCommunicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ import type {
SafeInfoExtended,
} from '@safe-global/safe-apps-sdk'
import { Methods, RPC_CALLS } from '@safe-global/safe-apps-sdk'
import type { Permission, PermissionRequest } from '@safe-global/safe-apps-sdk/dist/types/types/permissions'
import type {
Permission,
PermissionRequest,
} from 'node_modules/@safe-global/safe-apps-sdk/dist/types/types/permissions'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (and the other similar changes) are required to support the adjusted moduleResolution.

import type { SafeSettings } from '@safe-global/safe-apps-sdk'
import AppCommunicator from '@/services/safe-apps/AppCommunicator'
import { Errors, logError } from '@/services/exceptions'
Expand Down
2 changes: 1 addition & 1 deletion src/components/safe-apps/PermissionsPrompt.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ReactElement } from 'react'
import type { PermissionRequest } from '@safe-global/safe-apps-sdk/dist/types/types/permissions'
import type { PermissionRequest } from 'node_modules/@safe-global/safe-apps-sdk/dist/types/types/permissions'
import { Button, Dialog, DialogActions, DialogContent, Divider, Typography } from '@mui/material'

import { ModalDialogTitle } from '@/components/common/ModalDialog'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { faker } from '@faker-js/faker'
import { id, zeroPadValue } from 'ethers'
import { JsonRpcProvider } from 'ethers'
import cloneDeep from 'lodash/cloneDeep'
import type { Delay, TransactionAddedEvent } from '@gnosis.pm/zodiac/dist/cjs/types/Delay'
import type { Delay, TransactionAddedEvent } from 'node_modules/@gnosis.pm/zodiac/dist/cjs/types/Delay'
import type { TransactionReceipt } from 'ethers'

import {
Expand Down
2 changes: 1 addition & 1 deletion src/features/recovery/services/recovery-sender.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getModuleInstance, KnownContracts } from '@gnosis.pm/zodiac'
import type { SafeInfo } from '@safe-global/safe-gateway-typescript-sdk'
import type { SafeTransaction } from '@safe-global/safe-core-sdk-types'
import type { TransactionAddedEvent } from '@gnosis.pm/zodiac/dist/cjs/types/Delay'
import type { TransactionAddedEvent } from 'node_modules/@gnosis.pm/zodiac/dist/cjs/types/Delay'
import type { Eip1193Provider, TransactionResponse } from 'ethers'

import { didReprice, didRevert } from '@/utils/ethers-utils'
Expand Down
2 changes: 1 addition & 1 deletion src/features/recovery/services/recovery-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import memoize from 'lodash/memoize'
import { getMultiSendCallOnlyDeployment } from '@safe-global/safe-deployments'
import type { SafeInfo } from '@safe-global/safe-gateway-typescript-sdk'
import type { Delay } from '@gnosis.pm/zodiac'
import type { TransactionAddedEvent } from '@gnosis.pm/zodiac/dist/cjs/types/Delay'
import type { TransactionAddedEvent } from 'node_modules/@gnosis.pm/zodiac/dist/cjs/types/Delay'
import { toBeHex, type JsonRpcProvider, type TransactionReceipt } from 'ethers'
import { trimTrailingSlash } from '@/utils/url'
import { sameAddress } from '@/utils/addresses'
Expand Down
2 changes: 1 addition & 1 deletion src/features/swap/helpers/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { DecodedDataResponse, Order as SwapOrder } from '@safe-global/safe-gateway-typescript-sdk'
import { formatUnits } from 'ethers'
import type { AnyAppDataDocVersion, latest, LatestAppDataDocVersion } from '@cowprotocol/app-data'
import type { AnyAppDataDocVersion, latest, LatestAppDataDocVersion } from 'node_modules/@cowprotocol/app-data'

import { TradeType, UiOrderType } from '@/features/swap/types'

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/safe-apps/permissions/useSafePermissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
Permission,
PermissionCaveat,
PermissionRequest,
} from '@safe-global/safe-apps-sdk/dist/types/types/permissions'
} from 'node_modules/@safe-global/safe-apps-sdk/dist/types/types/permissions'

import { PermissionStatus } from '@/components/safe-apps/types'
import useLocalStorage from '@/services/local-storage/useLocalStorage'
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/wallets/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { InitOptions } from '@web3-onboard/core'
import coinbaseModule from '@web3-onboard/coinbase'
import injectedWalletModule from '@web3-onboard/injected-wallets'
import keystoneModule from '@web3-onboard/keystone/dist/index'
import ledgerModule from '@web3-onboard/ledger/dist/index'
import { ledgerModule } from '@/services/onboard/ledger-module'
import trezorModule from '@web3-onboard/trezor'
import walletConnect from '@web3-onboard/walletconnect'
import pkModule from '@/services/private-key-module'
Expand Down
Loading
Loading