Skip to content

Commit

Permalink
chore!: remove DAppKit (#5622)
Browse files Browse the repository at this point in the history
### Description

It's time to say good bye to DAppKit!
We thank you for being the very first way to interact with DApps on
Celo.

- DAppKit has been sunset since march 2023 
  - https://forum.celo.org/t/sunsetting-dappkit/5336
- no dapps on the dapps list are actively using it

### Test plan

- Tests pass

### Related issues

- Fixes RET-853
- Fixes ACT-1101
- Fixes ACT-1088

### Backwards compatibility

No, but nobody's using DAppKit anymore.

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [x] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
  • Loading branch information
jeanregisser committed Jul 8, 2024
1 parent 9698687 commit 2e02e91
Show file tree
Hide file tree
Showing 21 changed files with 12 additions and 578 deletions.
9 changes: 0 additions & 9 deletions e2e/src/DeepLinkDappkit.spec.js

This file was deleted.

26 changes: 0 additions & 26 deletions e2e/src/usecases/HandleDeepLinkDappkit.js

This file was deleted.

1 change: 0 additions & 1 deletion scripts/adb-dappkit.sh

This file was deleted.

10 changes: 0 additions & 10 deletions src/analytics/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -516,16 +516,6 @@ export enum WalletConnectEvents {
wc_copy_request_payload = 'wc_copy_request_payload',
}

export enum DappKitEvents {
dappkit_parse_deeplink_error = 'dappkit_parse_deeplink_error',
dappkit_request_propose = 'dappkit_request_propose',
dappkit_request_cancel = 'dappkit_request_cancel',
dappkit_copy_request_details = 'dappkit_copy_request_details',
dappkit_request_accept_start = 'dappkit_request_accept_start',
dappkit_request_accept_success = 'dappkit_request_accept_success',
dappkit_request_accept_error = 'dappkit_request_accept_error',
}

export enum CICOEvents {
persona_kyc_start = 'persona_kyc_start',
persona_kyc_success = 'persona_kyc_success',
Expand Down
28 changes: 0 additions & 28 deletions src/analytics/Properties.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { DappKitRequestTypes } from '@celo/utils'
import {
FiatAccountSchema,
FiatConnectError,
Expand All @@ -17,7 +16,6 @@ import {
CoinbasePayEvents,
ContractKitEvents,
DappExplorerEvents,
DappKitEvents,
DappShortcutsEvents,
EarnEvents,
EscrowEvents,
Expand Down Expand Up @@ -1082,31 +1080,6 @@ interface WalletConnectProperties {
[WalletConnectEvents.wc_copy_request_payload]: WalletConnectRequestDefaultProperties
}

interface DappKitRequestDefaultProperties {
dappRequestOrigin: DappRequestOrigin
dappName: string
dappUrl: string
requestType: DappKitRequestTypes
requestCallback: string
requestId: string
}

interface DappKitProperties {
[DappKitEvents.dappkit_parse_deeplink_error]: {
dappRequestOrigin: DappRequestOrigin
deeplink: string
error: string
}
[DappKitEvents.dappkit_request_propose]: DappKitRequestDefaultProperties
[DappKitEvents.dappkit_request_cancel]: DappKitRequestDefaultProperties
[DappKitEvents.dappkit_copy_request_details]: DappKitRequestDefaultProperties
[DappKitEvents.dappkit_request_accept_start]: DappKitRequestDefaultProperties
[DappKitEvents.dappkit_request_accept_success]: DappKitRequestDefaultProperties
[DappKitEvents.dappkit_request_accept_error]: DappKitRequestDefaultProperties & {
error: string
}
}

interface CICOEventsProperties {
[CICOEvents.persona_kyc_start]: undefined
[CICOEvents.persona_kyc_success]: undefined
Expand Down Expand Up @@ -1688,7 +1661,6 @@ export type AnalyticsPropertiesList = AppEventsProperties &
NavigationProperties &
RewardsProperties &
WalletConnectProperties &
DappKitProperties &
CICOEventsProperties &
DappExplorerEventsProperties &
WebViewEventsProperties &
Expand Down
15 changes: 7 additions & 8 deletions src/analytics/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
CoinbasePayEvents,
ContractKitEvents,
DappExplorerEvents,
DappKitEvents,
DappShortcutsEvents,
EarnEvents,
EscrowEvents,
Expand Down Expand Up @@ -515,13 +514,6 @@ export const eventDocs: Record<AnalyticsEventType, string> = {
[WalletConnectEvents.wc_request_deny_success]: `when the dapp request denial succeeds`,
[WalletConnectEvents.wc_request_deny_error]: `when the dapp request denial fails`,
[WalletConnectEvents.wc_copy_request_payload]: `when a user taps to copy the request payload from the bottom sheet`,
[DappKitEvents.dappkit_parse_deeplink_error]: `when dappkit fails to parse the deeplink`,
[DappKitEvents.dappkit_request_propose]: `when the dappkit request screen is displayed to accept/deny a dapp request`,
[DappKitEvents.dappkit_request_cancel]: `when user presses the button to cancel the dapp request`,
[DappKitEvents.dappkit_copy_request_details]: `when user presses the button to copy details of a dapp request`,
[DappKitEvents.dappkit_request_accept_start]: `when user presses the button to accept a dapp request`,
[DappKitEvents.dappkit_request_accept_success]: `when the dapp request succeeds`,
[DappKitEvents.dappkit_request_accept_error]: `when the dapp request fails`,
[CICOEvents.persona_kyc_start]: `when a user begins the Persona KYC process (clicks 'Set up ID Verification' button)`,
[CICOEvents.persona_kyc_success]: `when the onComplete callback is called for a Persona inquiry with success status`,
[CICOEvents.persona_kyc_failed]: `when the onComplete callback is called for a Persona inquiry with failed status`,
Expand Down Expand Up @@ -654,4 +646,11 @@ export const eventDocs: Record<AnalyticsEventType, string> = {
// [RequestEvents.request_error]: `when there is an error requesting a transaction`,
// [FiatExchangeEvents.cico_currency_chosen]: `User selects a currency and taps next`,
// [FiatExchangeEvents.cico_currency_back]: `User presses the back button from the currency screen`,
// [DappKitEvents.dappkit_parse_deeplink_error]: `when dappkit fails to parse the deeplink`,
// [DappKitEvents.dappkit_request_propose]: `when the dappkit request screen is displayed to accept/deny a dapp request`,
// [DappKitEvents.dappkit_request_cancel]: `when user presses the button to cancel the dapp request`,
// [DappKitEvents.dappkit_copy_request_details]: `when user presses the button to copy details of a dapp request`,
// [DappKitEvents.dappkit_request_accept_start]: `when user presses the button to accept a dapp request`,
// [DappKitEvents.dappkit_request_accept_success]: `when the dapp request succeeds`,
// [DappKitEvents.dappkit_request_accept_error]: `when the dapp request fails`,
}
2 changes: 1 addition & 1 deletion src/analytics/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export enum WalletConnectPairingOrigin {
Deeplink = 'deeplink',
}

// Origin of WalletConnect/DappKit request
// Origin of WalletConnect request
export enum DappRequestOrigin {
InAppWebView = 'in_app_web_view',
External = 'external',
Expand Down
15 changes: 0 additions & 15 deletions src/app/saga.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {
sentryNetworkErrorsSelector,
shouldRunVerificationMigrationSelector,
} from 'src/app/selectors'
import { handleDappkitDeepLink } from 'src/dappkit/dappkit'
import { activeDappSelector } from 'src/dapps/selectors'
import { FiatExchangeFlow } from 'src/fiatExchanges/utils'
import { initI18n } from 'src/i18n'
Expand Down Expand Up @@ -73,7 +72,6 @@ import {
import { createMockStore } from 'test/utils'
import { mockAccount, mockTokenBalances } from 'test/values'

jest.mock('src/dappkit/dappkit')
jest.mock('src/analytics/ValoraAnalytics')
jest.mock('src/sentry/Sentry')
jest.mock('src/sentry/SentryTransactionHub')
Expand Down Expand Up @@ -107,19 +105,6 @@ describe('handleDeepLink', () => {
jest.clearAllMocks()
})

it('Handles Dappkit deep link', async () => {
const deepLink = 'celo://wallet/dappkit?abcdsa'
await expectSaga(handleDeepLink, openDeepLink(deepLink))
.provide([[select(walletAddressSelector), mockAccount]])
.run()
expect(handleDappkitDeepLink).toHaveBeenCalledWith(deepLink)
expect(ValoraAnalytics.track).toHaveBeenCalledWith(AppEvents.handle_deeplink, {
pathStartsWith: 'dappkit',
fullPath: '/dappkit',
query: 'abcdsa',
})
})

it('Handles payment deep link', async () => {
const data = {
address: '0xf7f551752A78Ce650385B58364225e5ec18D96cB',
Expand Down
4 changes: 0 additions & 4 deletions src/app/saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import { CeloNewsConfig } from 'src/celoNews/types'
import { DEFAULT_APP_LANGUAGE, FETCH_TIMEOUT_DURATION, isE2EEnv } from 'src/config'
import { claimRewardsSuccess } from 'src/consumerIncentives/slice'
import { SuperchargeTokenConfigByToken } from 'src/consumerIncentives/types'
import { handleDappkitDeepLink } from 'src/dappkit/dappkit'
import { FiatExchangeFlow } from 'src/fiatExchanges/utils'
import { FiatAccountSchemaCountryOverrides } from 'src/fiatconnect/types'
import { appVersionDeprecationChannel, fetchRemoteConfigValues } from 'src/firebase/firebase'
Expand Down Expand Up @@ -315,7 +314,6 @@ export function* handleDeepLink(action: OpenDeepLink) {
// don't accidentally log sensitive information on new deeplinks. 'jumpstart' is specifically excluded
const pathStartsWithAllowList = [
'pay',
'dappkit',
'cashIn',
'bidali',
'cash-in-success',
Expand All @@ -331,8 +329,6 @@ export function* handleDeepLink(action: OpenDeepLink) {
})
if (rawParams.path.startsWith('/pay')) {
yield* call(handlePaymentDeeplink, deepLink)
} else if (rawParams.path.startsWith('/dappkit')) {
yield* call(handleDappkitDeepLink, deepLink)
} else if (rawParams.path === '/cashIn') {
navigate(Screens.FiatExchangeCurrencyBottomSheet, { flow: FiatExchangeFlow.CashIn })
} else if (rawParams.pathname === '/bidali') {
Expand Down
2 changes: 1 addition & 1 deletion src/app/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DappRequestOrigin } from 'src/analytics/types'
import { ActiveDapp } from 'src/dapps/types'

// Assume that if we have an active dapp, any WC or DappKit request comes from the in-app webview.
// Assume that if we have an active dapp, any WC request comes from the in-app webview.
// Note that this may be incorrect if the user interacts with another dapp while the dapp webview is open.
// I thought about comparing the request url to the active dapp url, but that could fail too if the dapp url we have is different.
// For instance the dapp-list could contain a "example.com", while the request is "dapp.something.com".
Expand Down
83 changes: 0 additions & 83 deletions src/dappkit/DappKitAccountScreen.tsx

This file was deleted.

Loading

0 comments on commit 2e02e91

Please sign in to comment.