Skip to content

Commit

Permalink
Revert "feat: Integrate phantom connection and account derivation (#847
Browse files Browse the repository at this point in the history
…)" (#905)
  • Loading branch information
rosepuppy committed Aug 8, 2024
1 parent e6e2c5c commit 4c6050d
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 431 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
"@scure/bip32": "^1.3.0",
"@scure/bip39": "^1.2.0",
"@skip-router/core": "^5.1.0",
"@solana/web3.js": "^1.93.0",
"@statsig/js-client": "1.4.0",
"@statsig/react-bindings": "1.4.0",
"@tanstack/react-query": "^5.37.1",
Expand All @@ -118,7 +117,6 @@
"crypto-js": "^4.1.1",
"ethers": "^6.6.1",
"export-to-csv": "^1.2.3",
"fast-json-stable-stringify": "^2.1.0",
"graz": "^0.0.43",
"jsdom": "^24.1.0",
"lodash": "^4.17.21",
Expand Down
42 changes: 19 additions & 23 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions src/constants/account.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { DydxAddress, EvmAddress } from './wallets';
import { SolAddress } from './wallets';

export enum OnboardingSteps {
ChooseWallet = 'ChooseWallet',
Expand Down Expand Up @@ -44,16 +43,6 @@ export type EvmDerivedAddresses = {
};
};

export type SolDerivedAddresses = {
version?: string;
} & Record<
SolAddress,
{
encryptedSignature?: string;
dydxAddress?: DydxAddress;
}
>;

export type Hdkey = {
mnemonic: string;
privateKey: Uint8Array | null;
Expand Down
3 changes: 0 additions & 3 deletions src/constants/localStorage.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
export enum LocalStorageKey {
// Onboarding / Accounts
EvmAddress = 'dydx.EvmAddress',
SolAddress = 'dydx.SolAddress',
DydxAddress = 'dydx.DydxAddress',
OnboardingSelectedWalletType = 'dydx.OnboardingSelectedWalletType',
WalletConnectionType = 'dydx.WalletConnectionType',
OnboardingHasAcknowledgedTerms = 'dydx.OnboardingHasAcknowledgedTerms',
EvmDerivedAddresses = 'dydx.EvmDerivedAddresses',
SolDerivedAddresses = 'dydx.SolDerivedAddresses',

// Gas
SelectedGasDenom = 'dydx.SelectedGasDenom',
Expand Down Expand Up @@ -38,7 +36,6 @@ export enum LocalStorageKey {

export const LOCAL_STORAGE_VERSIONS = {
[LocalStorageKey.EvmDerivedAddresses]: 'v2',
[LocalStorageKey.SolDerivedAddresses]: 'v1',
[LocalStorageKey.NotificationPreferences]: 'v2',
[LocalStorageKey.TransferNotifications]: 'v1',
[LocalStorageKey.Notifications]: 'v1',
Expand Down
13 changes: 0 additions & 13 deletions src/constants/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
MathWalletIcon,
MetaMaskIcon,
OkxWalletIcon,
PhantomIcon,
RainbowIcon,
TokenPocketIcon,
TrustWalletIcon,
Expand All @@ -37,7 +36,6 @@ export enum WalletConnectionType {
InjectedEip1193 = 'injectedEip1193',
WalletConnect2 = 'walletConnect2',
TestWallet = 'TestWallet',
Phantom = 'Phantom',
}

export enum WalletErrorType {
Expand Down Expand Up @@ -71,9 +69,6 @@ export const walletConnectionTypes: Record<WalletConnectionType, WalletConnectio
name: 'WalletConnect 2.0',
wagmiConnectorId: 'walletConnect',
},
[WalletConnectionType.Phantom]: {
name: 'Phantom',
},
[WalletConnectionType.CosmosSigner]: {
name: 'CosmosSigner',
},
Expand Down Expand Up @@ -107,7 +102,6 @@ export enum WalletType {
TestWallet = 'TEST_WALLET',
OtherWallet = 'OTHER_WALLET',
Privy = 'PRIVY',
Phantom = 'PHANTOM',
}

const WALLET_CONNECT_EXPLORER_RECOMMENDED_WALLETS = {
Expand Down Expand Up @@ -283,12 +277,6 @@ export const wallets: Record<WalletType, WalletConfig> = {
icon: EmailIcon,
connectionTypes: [WalletConnectionType.Privy],
},
[WalletType.Phantom]: {
type: WalletType.Phantom,
stringKey: STRING_KEYS.PHANTOM,
icon: PhantomIcon,
connectionTypes: [WalletConnectionType.Phantom],
},
};

// Injected EIP-1193 Providers
Expand Down Expand Up @@ -344,7 +332,6 @@ export const getSignTypedData = (selectedDydxChainId: DydxChainId) =>
export type PrivateInformation = ReturnType<typeof onboarding.deriveHDKeyFromEthereumSignature>;

export type EvmAddress = `0x${string}`;
export type SolAddress = `${string}`;
export type DydxAddress = `dydx${string}`;

export const DYDX_CHAIN_INFO: Parameters<typeof suggestChain>[0] = {
Expand Down
Loading

0 comments on commit 4c6050d

Please sign in to comment.