Skip to content

Commit

Permalink
use eclipse wallet adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
dandlezzz committed Sep 15, 2023
1 parent fe66d3c commit 132758f
Show file tree
Hide file tree
Showing 26 changed files with 79 additions and 173 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"license": "GPL-3.0-only",
"dependencies": {
"4m-wallet-adapter": "^0.0.97",
"eclipse-wallet-adapter": "^0.0.97",
"@emotion/react": "^11.10.4",
"@emotion/styled": "^11.10.4",
"@mui/material": "^5.10.4",
Expand Down
2 changes: 1 addition & 1 deletion src/component-library/CardButton/CardButtonTransaction.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext } from 'react';
import { StyleSheet, View } from 'react-native';
import { formatAmount } from '4m-wallet-adapter';
import { formatAmount } from 'eclipse-wallet-adapter';

import theme from '../Global/theme';
import GlobalImage from '../Global/GlobalImage';
Expand Down
2 changes: 1 addition & 1 deletion src/component-library/Layout/Header.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useContext, useEffect, useState } from 'react';
import theme from '../../component-library/Global/theme';
import { StyleSheet, SafeAreaView, TouchableOpacity, View } from 'react-native';
import { getNetworks, getSwitches } from '4m-wallet-adapter';
import { getNetworks, getSwitches } from 'eclipse-wallet-adapter';
import { AppContext } from '../../AppProvider';
import { useNavigation } from '../../routes/hooks';
import { ROUTES_MAP as ROUTES_WALLET_MAP } from '../../pages/Wallet/routes';
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useAccounts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useMemo, useState } from 'react';
import { AccountFactory, getNetworks, getPathIndex } from '4m-wallet-adapter';
import { AccountFactory, getNetworks, getPathIndex } from 'eclipse-wallet-adapter';
import { mapValues, merge, omit } from 'lodash';
import http from 'axios';

Expand All @@ -9,7 +9,7 @@ import { lock, unlock } from '../utils/password';
import stash from '../utils/stash';
import storage from '../utils/storage';
import STORAGE_KEYS from '../utils/storageKeys';
import { SALMON_API_URL } from '4m-wallet-adapter/constants/environment';
import { SALMON_API_URL } from 'eclipse-wallet-adapter/constants/environment';

const getDefaultPathIndex = (account, networkId) => {
return account.networksAccounts[networkId]?.findIndex(Boolean) || 0;
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useAddressbook.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect } from 'react';
import { getNetwork, getNetworks } from '4m-wallet-adapter';
import { getNetwork, getNetworks } from 'eclipse-wallet-adapter';
import storage from '../utils/storage';
import STORAGE_KEYS from '../utils/storageKeys';

Expand Down
2 changes: 1 addition & 1 deletion src/pages/Adapter/AdapterPage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useContext, useEffect, useState } from 'react';
import { BLOCKCHAINS, getNetworks, getSwitches } from '4m-wallet-adapter';
import { BLOCKCHAINS, getNetworks, getSwitches } from 'eclipse-wallet-adapter';

import { AppContext } from '../../AppProvider';
import AdapterSelect from './components/AdapterSelect';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Adapter/components/AdapterDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React, {
useState,
} from 'react';

import { getMetadata } from '4m-wallet-adapter';
import { getMetadata } from 'eclipse-wallet-adapter';

import GlobalSkeleton from '../../../component-library/Global/GlobalSkeleton';

Expand Down
2 changes: 1 addition & 1 deletion src/pages/Nfts/NftsDetailPage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useContext, useEffect, useState } from 'react';
import { StyleSheet, View, FlatList } from 'react-native';
import { get } from 'lodash';
import { BLOCKCHAINS, getSwitches } from '4m-wallet-adapter';
import { BLOCKCHAINS, getSwitches } from 'eclipse-wallet-adapter';

import { AppContext } from '../../AppProvider';
import { useNavigation, withParams } from '../../routes/hooks';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Nfts/NftsListPage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext, useEffect, useState } from 'react';
import { View, StyleSheet } from 'react-native';
import { getSwitches } from '4m-wallet-adapter';
import { getSwitches } from 'eclipse-wallet-adapter';

import { AppContext } from '../../AppProvider';
import { useNavigation } from '../../routes/hooks';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Onboarding/CreateWalletPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
getTopTokensByPlatform,
BLOCKCHAINS,
PLATFORMS,
} from '4m-wallet-adapter';
} from 'eclipse-wallet-adapter';

import { AppContext } from '../../AppProvider';
import { useNavigation } from '../../routes/hooks';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Onboarding/DerivedAccountsPage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext, useEffect, useState } from 'react';
import { StyleSheet, View } from 'react-native';
import { BLOCKCHAINS, NetworkAccountFactory } from '4m-wallet-adapter';
import { BLOCKCHAINS, NetworkAccountFactory } from 'eclipse-wallet-adapter';

import AvatarImage from '../../component-library/Image/AvatarImage';
import CardButton from '../../component-library/CardButton/CardButton';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Onboarding/RecoverWalletPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
getTopTokensByPlatform,
BLOCKCHAINS,
PLATFORMS,
} from '4m-wallet-adapter';
} from 'eclipse-wallet-adapter';

import { AppContext } from '../../AppProvider';
import { useNavigation } from '../../routes/hooks';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Settings/AccountEditPrivateKeyPage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext, useEffect, useState } from 'react';
import { StyleSheet, View } from 'react-native';
import { getNetworks } from '4m-wallet-adapter';
import { getNetworks } from 'eclipse-wallet-adapter';

import { AppContext } from '../../AppProvider';
import { ROUTES_MAP as ROUTES_SETTINGS_MAP } from './routes';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Settings/ChangeNetworkPage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useContext, useEffect, useState } from 'react';
import { getNetworks, getSwitches } from '4m-wallet-adapter';
import { getNetworks, getSwitches } from 'eclipse-wallet-adapter';

import { AppContext } from '../../AppProvider';
import { useNavigation } from '../../routes/hooks';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Token/TokenDetailPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, {
useMemo,
useCallback,
} from 'react';
import { getSwitches } from '4m-wallet-adapter';
import { getSwitches } from 'eclipse-wallet-adapter';
import { get } from 'lodash';

import { AppContext } from '../../AppProvider';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Token/TokenSendPage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useContext, useMemo } from 'react';
import { StyleSheet, View, Linking } from 'react-native';
import { BLOCKCHAINS } from '4m-wallet-adapter';
import { BLOCKCHAINS } from 'eclipse-wallet-adapter';
import { pick } from 'lodash';

import { AppContext } from '../../AppProvider';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Transactions/TransactionsDetailPage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext, useEffect, useState, useCallback } from 'react';
import { StyleSheet, View, Linking, TouchableOpacity } from 'react-native';
import { formatAmount } from '4m-wallet-adapter';
import { formatAmount } from 'eclipse-wallet-adapter';
import moment from 'moment';

import theme from '../../component-library/Global/theme';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Wallet/BridgePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
getBridgeEstimatedAmount,
getBridgeMinimalAmount,
createBridgeExchange,
} from '4m-wallet-adapter';
} from 'eclipse-wallet-adapter';
import Header from '../../component-library/Layout/Header';
import GlobalSkeleton from '../../component-library/Global/GlobalSkeleton';
import BasicRadios from '../../component-library/Radios/BasicRadios';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Wallet/SwapPage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext, useEffect, useMemo, useState } from 'react';
import { StyleSheet, Linking, View } from 'react-native';
import { BLOCKCHAINS, formatAmount } from '4m-wallet-adapter';
import { BLOCKCHAINS, formatAmount } from 'eclipse-wallet-adapter';
import { AppContext } from '../../AppProvider';
import { useNavigation } from '../../routes/hooks';
import { withTranslation } from '../../hooks/useTranslations';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Wallet/WalletOverviewPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, {
useMemo,
useState,
} from 'react';
import { getSwitches } from '4m-wallet-adapter';
import { getSwitches } from 'eclipse-wallet-adapter';
import { get, isNil } from 'lodash';

import { AppContext } from '../../AppProvider';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Wallet/WalletPage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useContext, useEffect } from 'react';
import { getSwitches } from '4m-wallet-adapter';
import { getSwitches } from 'eclipse-wallet-adapter';

import { AppContext } from '../../AppProvider';
import { useNavigation } from '../../routes/hooks';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Wallet/components/NetworkSelector.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { BLOCKCHAINS } from '4m-wallet-adapter';
import { BLOCKCHAINS } from 'eclipse-wallet-adapter';
import theme, { globalStyles } from '../../../component-library/Global/theme';
import BasicSelect from '../../../component-library/Selects/BasicSelect';
import GlobalText from '../../../component-library/Global/GlobalText';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Wallet/components/PendingBridgeTxs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { getBridgeTransaction } from '4m-wallet-adapter';
import { getBridgeTransaction } from 'eclipse-wallet-adapter';
import { withTranslation } from '../../../hooks/useTranslations';
import GlobalCollapse from '../../../component-library/Global/GlobalCollapse';
import CardButtonPendingTx from '../../../component-library/CardButton/CardButtonPendingTx';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Wallet/components/PendingTxs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext, useEffect, useState } from 'react';
import { StyleSheet, View } from 'react-native';
import { BLOCKCHAINS } from '4m-wallet-adapter';
import { BLOCKCHAINS } from 'eclipse-wallet-adapter';
import GlobalCollapse from '../../../component-library/Global/GlobalCollapse';
import CardButtonPendingTx from '../../../component-library/CardButton/CardButtonPendingTx';
import GlobalText from '../../../component-library/Global/GlobalText';
Expand Down
2 changes: 1 addition & 1 deletion src/utils/amount.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { round, isNil } from 'lodash';
import { formatAmount } from '4m-wallet-adapter';
import { formatAmount } from 'eclipse-wallet-adapter';

export const showAmount = (amount, decimals = 2) =>
!isNil(amount) ? `$${round(amount, decimals).toFixed(decimals)}` : '-';
Expand Down
Loading

0 comments on commit 132758f

Please sign in to comment.